-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
Relative Import Path of package dependencies throw error on build #715
Comments
Yes, this is due a bug (or a behavior change, I don't know) of Deno. I'll try to find another way to resolve npm dependencies in Deno. import radix from "https://esm.sh/radix-ui"; |
That's very helpful to know! I'll keep an eye on that thread. (and thanks for the quick reply) SO with ESM, if I mark it as external ( If I dont mark it as external I keep getting errors like |
I suspect this bug won't be fixed anytime soon, because they didn't respond in 3 weeks. I've trying to fix the plugin using the import_map package instead of relying on Deno's This has the benefit of defining a custom import map for the esbuild, independent of the Can you try it now? It's available in the latest development version of Lume. You can upgrade it with If it doesn't work and you have a public repo with your code, I can take a look. |
@oscarotero - I think that solved it, at least for ESM imports. (Still running into some issues with React conflicting, but I think those are probably ME problems lol and nothing to do with Lume.) There may still be an issue with
Which if you use the ESM CLI, it actually adds both automatically. |
If you want to take a look you can see the repo here: https://github.com/tspears1/projects.bu.edu |
Ok, I've commited new changes to Lume (you can run
|
Thanks @oscarotero - this is all extremely helpful and I can take it from here. Appreciate all your help - loving Lume and the Lume CMS! |
I've been playing with your repo a bit more and discover that esm.sh mixes React 18 and 19. Maybe this is why JS breaks in the browser. |
Ah! This is what I suspected but wasn't able to prove yet. Yeah I think that's right. React 19 keeps popping up in my |
Version
2.4.3
Platform
OSX
What steps will reproduce the bug?
I'm using the
radix-ui
library for building a React client-side app on my site with esbuild to compile. I've tried adding these packages with ESM and NPM and in both cases, if the package has dependencieslume-loader
throws an error like the following for@radix-ui/react-dialog
:deno:file:///Users/user/Library/Caches/deno/npm/registry.npmjs.org/@radix-ui/react-dialog/1.1.4/dist/index.mjs:16:29:ERROR: [plugin: lume-loader] Relative import path "react-remove-scroll" not prefixed with / or ./ or ../ and not in import map from "https://deno.land/x/lume@v2.4.3/plugins/esbuild.ts"
I even have those particularly directories ignored by LUME however it seems they're still being processed. I've gotten around it a few times by adding the package dependency to the import map, but its a tedious process and not always successful. Any suggestions?
How often does it reproduce? Is there a required condition?
No response
What is the expected behavior?
Libraries to be imported without conflict.
What do you see instead?
Additional information
No response
The text was updated successfully, but these errors were encountered: