next-view-transitions icon indicating copy to clipboard operation
next-view-transitions copied to clipboard

Testing error: code: 'ERR_MODULE_NOT_FOUND'

Open oliviadang2024 opened this issue 9 months ago • 0 comments

When I test the component using <Link> (imported from next-view-transition), it shows this error:

Error: Cannot find module 'my-project/node_modules/.pnpm/[email protected][email protected]_@[email protected]_@[email protected]_react-dom_ij7rotrze5kexwddyuvkazu2ry/node_modules/next/link' imported from my-project/node_modules/.pnpm/[email protected][email protected]_@[email protected]_@[email protected]_react-dom_ij7rotrze5kexwddyuvkazu2ry/node_modules/next-view-transitions/dist/index.js Did you mean to import [email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/next/link.js? ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { code: 'ERR_MODULE_NOT_FOUND' }

My project is using next 13.5.2, which is different from next-view-transition next 14. However, <Link> is a basic feature and should not be an issue. When I run pnpm dev, or build then start, the application still works perfectly fine. Just the tests are failing. I'm using @testing-library/react

oliviadang2024 avatar May 22 '24 00:05 oliviadang2024