I'm running into this issue while running Jest v27.4.7:
TypeError: Cannot read properties of undefined (reading 'filepath')
at Object.parse (node_modules/prettier-plugin-tailwindcss/dist/index.js:145:1735)
at Object.parse$d [as parse] (node_modules/prettier/index.js:12975:19)
at coreFormat (node_modules/prettier/index.js:14525:16)
at formatWithCursor$1 (node_modules/prettier/index.js:14765:14)
at node_modules/prettier/index.js:60959:12
at Object.format (node_modules/prettier/index.js:60979:12)
This seems to happen when Jest tries to write out an inline snapshot:
test('a test', () => {
// In this case, the inline snapshot has not been written yet. When running tests with
// Jest, it fails with the error above and the inline snapshot is never written.
expect('abc').toMatchInlineSnapshot()
})
I'm running into this issue while running Jest v27.4.7:
This seems to happen when Jest tries to write out an inline snapshot: