-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[🐞] Path Resolution Issue: '~/' Prefix Not Resolving Modules Properly #4948
Comments
I am facing the same issue |
Is this a windows issue? |
Hi Miško |
It would be great if someone with a Windows machine could look into it. |
I couldn't reproduce the bug on Windows 11 (in/out WSL) everything works fine. Maybe W10 path resolution is different System info
|
@mhevery the problem is easily reproducible on Windows 11 in OS: Windows 11 Pro
Version: 22H2
OS build: 22621.2215
Processor: Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz 2.30 GHz
node: 20.6.1
npm: 9.8.1
pnpm: 8.7.4 Here is the detailed error log on Windows 11 Powershell 07:31:17 [vite] warning: Parsing error: ESLint was configured to run on `D:\Sources\qwik-app\src\routes\layout.tsx` using `parserOptions.project`: <tsconfigRootDir>/tsconfig.json
However, that TSConfig does not include this file. Either:
- Change ESLint's list of included files to not include this file
- Change that TSConfig to include this file
- Create a new TSConfig that includes this file and include it in your parserOptions.project
See the typescript-eslint docs for more info: https://typescript-eslint.io/linting/troubleshooting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file
Plugin: vite-plugin-qwik
File: D:/Sources/qwik-app/src/routes/layout.tsx:undefined:undefined
Failed to load url ~/components/starter/header/header (resolved id: ~/components/starter/header/header) in D:/Sources/qwik-app/src/routes/layout.tsx. Does the file exist?
Failed to load url ~/components/starter/footer/footer (resolved id: ~/components/starter/footer/footer) in D:/Sources/qwik-app/src/routes/layout.tsx. Does the file exist?
07:31:20 [vite] Error when evaluating SSR module C:/Users/Yoga/Sources/qwik-app/src/routes/layout.tsx: failed to import "~/components/starter/header/header"
|- Error: Cannot find module '~/components/starter/header/header' imported from 'D:/Sources/qwik-app/src/routes/layout.tsx'
at nodeImport (file:///D:/Sources/qwik-app/node_modules/vite/dist/node/chunks/dep-3b8eb186.js:55956:25)
at ssrImport (file:///D:/Sources/qwik-app/node_modules/vite/dist/node/chunks/dep-3b8eb186.js:55858:30)
at eval (D:/Sources/qwik-app/src/routes/layout.tsx:11:37)
at async instantiateModule (file:///D:/Sources/qwik-app/node_modules/vite/dist/node/chunks/dep-3b8eb186.js:55920:9)
07:31:20 [vite] Internal server error: Cannot find module '~/components/starter/header/header' imported from 'D:/Sources/qwik-app/src/routes/layout.tsx'
File: /Sources/qwik-app/src/routes/layout.tsx:11:37
at nodeImport (file:///D:/Sources/qwik-app/node_modules/vite/dist/node/chunks/dep-3b8eb186.js:55956:25)
at ssrImport (file:///D:/Sources/qwik-app/node_modules/vite/dist/node/chunks/dep-3b8eb186.js:55858:30)
at eval (D:/Sources/qwik-app/src/routes/layout.tsx:11:37)
at async instantiateModule (file:///D:/Sources/qwik-app/node_modules/vite/dist/node/chunks/dep-3b8eb186.js:55920:9)
07:32:38 [vite] Internal server error: Cannot find module '~/components/starter/header/header' imported from 'D:/Sources/qwik-app/src/routes/layout.tsx'
File: /Sources/qwik-app/src/routes/layout.tsx:11:37
at nodeImport (file:///D:/Sources/qwik-app/node_modules/vite/dist/node/chunks/dep-3b8eb186.js:55956:25)
at ssrImport (file:///D:/Sources/qwik-app/node_modules/vite/dist/node/chunks/dep-3b8eb186.js:55858:30)
at eval (D:/Sources/qwik-app/src/routes/layout.tsx:11:37)
at async instantiateModule (file:///D:/Sources/qwik-app/node_modules/vite/dist/node/chunks/dep-3b8eb186.js:55920:9) (x2) The application runs fine on WSL2 |
I will look into this issue. First, need to identify if the issue is windows only. |
Hi your reproduction link is not working, can you provide a working one. |
For me, the problem is with the FS module which is unable to follow the symlink in Windows. |
If someone with Windows could try to create a fix I would be happy to provide support. |
Currently trying to reproduce this issue on Windows 11 with the steps provided in the description:
Maybe it's possible that the issue is either resolved or an isolated issue with Windows 10? @Dv-Joan |
@DerTimonius @mhevery the issue is with the fs package being unable to handle Windows symlinks. |
@sarvex Is there a specific fs issue related to this problem? Can you post here the link? |
I can put in the steps to reproduce the issue, and the issue is not only with Qwik but also with other frameworks that create project files like Astro or Svelte
You will see problems like files not found, CSS not loaded, etc... |
Are you using powershell or WSL2? |
@sarvex Looks like nodejs and symlinking on windows isn't a great combo? nodejs/node#18518 I presume that the symlink you created is an actual symlink and not a .lnk file? |
@sarvex I used npm and yarn fyi |
@DerTimonius the issue is not with the package manager, but rather with symlink. if you try again you will be able to reproduce the issue. |
Sorry man, I deleted the repo |
Do you have the same issue with the latest version of Qwik (v. 1.3.1) ? |
Did you remove node_modules and install the deps again with pnpm? |
@kralion Did you solve this issue or is it still open? |
Hello @kralion. Please provide the missing information requested above. |
Which component is affected?
Qwik Runtime
Describe the bug
I am running npm start for the first time, What i expect is the first renfer of Qwik. What actually happening is
Reproduction
https://github.com/Dv-Joan/qwik-issue-repo.git
Steps to reproduce
Create the Basic app template followed by npm install and finally npm start
System Info
Additional Information
Files are there
This is my tsconfig.json
and i tried this modification
but it doesn't work. I have to use this type of import
to work but on all files to make it work
The text was updated successfully, but these errors were encountered: