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

[🐞] Cannot find module '/@builder.io/qwik/build' #4465

Closed
devatina11yb opened this issue Jun 12, 2023 · 3 comments · Fixed by #4475
Closed

[🐞] Cannot find module '/@builder.io/qwik/build' #4465

devatina11yb opened this issue Jun 12, 2023 · 3 comments · Fixed by #4475
Labels
STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working

Comments

@devatina11yb
Copy link

devatina11yb commented Jun 12, 2023

Which component is affected?

Qwik Runtime

Describe the bug

I am unable to run any test, I get the following error when calling createDOM():

Error: Cannot find module '/@builder.io/qwik/build' imported from '<absolute_path_to>/node_modules/.pnpm/@builder.io+qwik@1.1.5_undici@5.22.1/node_modules/@builder.io/qwik/core.mjs'.

- If you rely on tsconfig.json to resolve modules, please install "vite-tsconfig-paths" plugin to handle module resolution.
 - Make sure you don't have relative aliases in your Vitest config. Use absolute paths instead. Read more: https://vitest.dev/guide/common-errors
 ❯ node_modules/.pnpm/@builder.io+qwik@1.1.5_undici@5.22.1/node_modules/@builder.io/qwik/core.mjs:1:31
      1| /**
      2|  * @license
      3|  * @builder.io/qwik 1.1.5
       |               ^
      4|  * Copyright Builder.io, Inc. All Rights Reserved.
      5|  * Use of this source code is governed by an MIT-style license that can be
 ❯ tests/MyComponent.spec.tsx:1:31

Reproduction

https://stackblitz.com/github/devatina11yb/qwik-testing

Steps to reproduce

StackBlitz seems to think I am using npm even though I am actually using pnpm. You will probably need to delete both package-lock.json and pnpm-lock.yaml and then run pnpm install.

  1. pnpm install
  2. pnpm run test

System Info

@builder.io/qwik: 1.1.5
typescript: 5.1.3
undici: 5.22.1
vite: 4.3.9
vitest: 0.32.0

Windows: 11
pnpm: 8.6.1

Additional Information

I also tried with npm and I get the exact same error so it doesn't seem to be related to pnpm.

@devatina11yb devatina11yb added TYPE: bug Something isn't working STATUS-1: needs triage New issue which needs to be triaged labels Jun 12, 2023
@ahnpnl
Copy link
Contributor

ahnpnl commented Jun 13, 2023

Latest version of Vitest introduced breaking change which is something related to inline deps. Vitest 0.31.2 or something had the same issue then they fixed it and now latest version they decided to make it as a breaking change

@devatina11yb
Copy link
Author

Thank you for your answer, it is indeed related to Vitest so I'll close this one.

@ahnpnl
Copy link
Contributor

ahnpnl commented Jun 23, 2023

Vitest actually fixed the problem vitest-dev/vitest#3544 in 0.32.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants