When building with Webpack 5 we get the following error from Vitest that cannot be resolved by reinstalling the node_modules or clearing the yarn.lock file. NB. The correct version of local-pkg (0.4.2) is present in the node_modules file.
Any help on this error would be greatly appreciated.
Module not found: Error: Can't resolve 'module' in '.../node_modules/local-pkg'
Hello @JackWP1. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction will be closed if they have no activity within 3 days.
Describe the bug
When building with Webpack 5 we get the following error from Vitest that cannot be resolved by reinstalling the node_modules or clearing the yarn.lock file. NB. The correct version of local-pkg (0.4.2) is present in the node_modules file.
Any help on this error would be greatly appreciated.
Module not found: Error: Can't resolve 'module' in '.../node_modules/local-pkg'
setup:
// package.json
// vite.config.ts
// tsconfig.json
Reproduction
yarn && yarn build
System Info
Used Package Manager
yarn
Validations