Open weyert opened 1 year ago
If I add vfile
to the transpilePackages
-configuration in next.config.js
I am getting the following error:
Cannot find module '../../src/lib/index.js' from 'node_modules/vfile/index.js'
The code in the vfile/index.js
file is:
export {VFile} from './lib/index.js'
``
I am not sure why the path changes to `'../../src/lib/index.js'`?
@shuding Ticket :)
Link to the code that reproduces this issue or a replay of the bug
https://github.com/weyert/nextjs-jest-markdown
To Reproduce
npm run dev
http://127.0.0.1:3000
This is a Markdown paragraph
get renderednpm run test
src/__tests__/pages/StartPage.test.tsx
andsrc/components/__tests__/PageContent.test.tsx
Current vs. Expected behavior
I would expect that I can write unit tests with packages that get transpiled instead I am getting the error:
Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
Jest (next/jest)
Additional context
I made a reproduction repository (see above) for an problem I am experiencing in a work project that uses an older version of Next.js (13.4.12) but planning to upgrade to 13.4.20 once its released to solve my modularize import issue from a previous ticket.
I am trying to write unit tests for components that consume the
react-markdown
package but fail to do so