-
Notifications
You must be signed in to change notification settings - Fork 60
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
A file might be imported multiple times on Windows #151
Comments
I have to say sorry that this issue is completely misleading... After some investigation I found the true issue. First of all, the multiple paths only affects the cache, jiti uses filename to do hash so different paths will lead to different transpiled files, but it won't cause a file to be imported more than once, just a minor performance issue. The real cause is Lines 154 to 156 in 79eeafb
Lines 173 to 176 in 79eeafb
I think we should pass |
But I don't know why it works on linux, maybe it got successfully resolved via another branch |
Update: It is still possible to cause duplicated imports by using different paths on Windows. Now I think we should split this issue into 2. |
Environment
Windows
Reproduction
I created one on stackblitz but it is on Linux, so please download it and run it on Windows.
I met this bug when I was using stub mode of unbuild, so this reproduction is based on that.
https://stackblitz.com/edit/stackblitz-starters-m3lfbv1
Describe the bug
Windows support
\
and/
as path separator, so a file might be imported more than once with different path on Windows, for exampleC:\foo.ts
andC:/foo.ts
. It causes problems when this file has side effects.Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: