Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERR_MODULE_NOT_FOUND #5070

Closed
6 tasks done
C0ZEN opened this issue Jan 29, 2024 · 2 comments · Fixed by #5079
Closed
6 tasks done

ERR_MODULE_NOT_FOUND #5070

C0ZEN opened this issue Jan 29, 2024 · 2 comments · Fixed by #5079

Comments

@C0ZEN
Copy link

C0ZEN commented Jan 29, 2024

Describe the bug

There are sometime some errors while running the tests that happened only on the CI (GitHub).

The stack trace:

Error:  ⎯⎯⎯⎯⎯⎯ Failed Suites 1 ⎯⎯⎯⎯⎯⎯⎯
Error: 
Error:   FAIL  x.test.tsx [ x.test.tsx ]
Error:  Error: Cannot find module '/home/runner/actions-runner/_work/x/node_modules/.vitest/deps/react_jsx-runtime.js' imported from /home/runner/actions-runner/_work/x/node_modules/vite-node/dist/client.mjs
Error:  ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Error:  Serialized Error: { code: 'ERR_MODULE_NOT_FOUND' }
Error:  ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯

Reproduction

Not possible.

System Info

System:
    OS: macOS 14.2.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 73.50 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.17.1 - ~/.asdf/installs/nodejs/18.17.1/bin/node
    npm: 9.6.7 - ~/.asdf/plugins/nodejs/shims/npm
  Browsers:
    Brave Browser: 120.1.61.120
    Chrome: 120.0.6099.234
    Safari: 17.2.1
  npmPackages:
    @vitejs/plugin-react: 4.2.1 => 4.2.1 
    @vitest/coverage-v8: 1.2.1 => 1.2.1 
    @vitest/ui: 1.2.1 => 1.2.1 
    vite: 5.0.12 => 5.0.12 
    vitest: 1.2.1 => 1.2.1

Used Package Manager

npm

Validations

@sheremet-va
Copy link
Member

This happens because your dependencies are not optimized correctly. You can disable optimizer for now, or add react/jsx-runtime to exclude:

export default defineConfig({
  test: {
	deps: {
	  optimizer: {
	    web: {
	      exclude: ['react/jsx-runtime'],
	      // or disable alltogether
	      enabled: false,
	    }
	  }
	}
  }
})

@C0ZEN
Copy link
Author

C0ZEN commented Jan 31, 2024

@sheremet-va OK thanks, is it to be expected to have a potential bug fix incoming?

@github-actions github-actions bot locked and limited conversation to collaborators Feb 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants