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 use stub with file:// protocol and esno (WSL2) #377

Open
MarvinXu opened this issue Mar 15, 2024 · 5 comments
Open

cannot use stub with file:// protocol and esno (WSL2) #377

MarvinXu opened this issue Mar 15, 2024 · 5 comments

Comments

@MarvinXu
Copy link

Environment

Win 11, WSL2
unbuild@2.0.0

Reproduction

  1. create project following usage in Ubuntu WSL2
  2. run npx unbuild --stub

Describe the bug

Output file dist/index.mjs have incorrect filepath of jiti ( file:// points to Windows file system while the following path is in Linux subsystem)

import jiti from "file:///home/marv/.npm/_npx/97e73b3cab55bb68/node_modules/jiti/lib/index.js";
...

Additional context

No response

Logs

No response

@pi0
Copy link
Member

pi0 commented Mar 15, 2024

fixed?

@MarvinXu
Copy link
Author

No. I'm just having second thoughts on if it's a bug of this package😂. The output .mjs can be run correctly with command node index.mjs, it just can't be resolved in other projects.
image

@pi0
Copy link
Member

pi0 commented Mar 15, 2024

it just can't be resolved in other projects.

Okay interesting. It seems esno does not likes import with file:// protocol. /cc @antfu just to be in context.

@pi0 pi0 changed the title Incorrect import path of jiti with '--stub' option in WSL cannot use stub with file:// protocol and esno Mar 15, 2024
@pi0 pi0 reopened this Mar 15, 2024
@pi0
Copy link
Member

pi0 commented Mar 15, 2024

(opened to investigate if we can do anything to mitigate this)

@pi0 pi0 changed the title cannot use stub with file:// protocol and esno cannot use stub with file:// protocol and esno (WSL2) Mar 15, 2024
@MarvinXu
Copy link
Author

BTW, vscode doesn't seem to resolve this path either. I'll have to remove file://
recording

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants