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

Wrong path normalization #155

Open
devingfx opened this issue Nov 15, 2024 · 0 comments
Open

Wrong path normalization #155

devingfx opened this issue Nov 15, 2024 · 0 comments

Comments

@devingfx
Copy link

devingfx commented Nov 15, 2024

I had a weird error where a folder wasn't the good one with relative imports:

✘ [ERROR] Module not found "file:///home/dig/dev/vanill.es/apps/actions/svg/Action.js". [plugin deno-loader]

    ../vanill.es/apps/actions/svg/viewport/ViewportScaleAction.js:5:19:
      5 │ import Action from '../../Action.js'~~~~~~~~~~~~~

As you can see ../../Action.js from actions/svg/viewport should leads to action/Action.js and not actions/svg/Action.js

I was stuck figure out why until I try to resolve a fake ./ module to kinda see what's the current folder:

✘ [ERROR] Module not found "file:///home/dig/dev/vanill.es/apps/actions/svg//viewport/Action.js". [plugin deno-loader]

    ../vanill.es/apps/actions/svg/viewport/ViewportScaleAction.js:5:19:
      5 │ import Action from './Action.js'~~~~~~~~~~~~~

Then I could figure out a double slash typo in the module hierarchy (in fact a bad copy/paste) so it end's up trying to use this import specifier actions/svg//viewport/Action.js with a typo, path which should be normalized to actions/svg/viewport/Action.js to avoid taking the empty string between the double slash to be a folder to take account when resolving parent folders.

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

1 participant