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

Modules with a query string are not stored where the resolver expects them #161

Closed
jcayzac opened this issue Feb 26, 2021 · 1 comment
Closed
Labels
✘ bug Something isn't working

Comments

@jcayzac
Copy link

jcayzac commented Feb 26, 2021

If the import URL of a module has a query string, e.g.

 {
   "imports": {
     "aleph": "https://deno.land/x/aleph@v0.3.0-alpha.1/mod.ts",
     "aleph/": "https://deno.land/x/aleph@v0.3.0-alpha.1/",
     "react": "https://esm.sh/react@17.0.1",
-    "react-dom": "https://esm.sh/react-dom@17.0.1"
+    "react-dom": "https://esm.sh/react-dom@17.0.1",
+    "twind": "https://esm.sh/twind?no-check"
   },
   "scopes": {}
 }

…then the query string is included in the base filename of the module stored on-disk, like this:

.aleph/development/-/esm.sh/twind.js_no-check.js
.aleph/development/-/esm.sh/twind.js_no-check.js.map
.aleph/development/-/esm.sh/twind.js_no-check.meta.json

…but the resolver at

pub fn fix_import_url(&self, url: &str) -> String {

…when importing the module, expects a file at:

.aleph/development/-/esm.sh/twind_no-check.js

…and aleph dev produces the following error:

ERROR TypeError: Cannot resolve module
"file:///Users/jcayzac/hello/.aleph/development/-/esm.sh/twind_no-check.js" from
"file:///Users/jcayzac/hello/.aleph/development/app.f4f4f1634.js".
@ije ije added the ✘ bug Something isn't working label Feb 26, 2021
@ije
Copy link
Member

ije commented Feb 26, 2021

@jcayzac thanks, i already rewritten the loader system that should fix this

@ije ije closed this as completed Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✘ bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants