Dynamic file imports inside JSR packages not working #26266
Replies: 2 comments
-
I'm having the same issue with https://jsr.io/@baseless/client/0.3.0-rc.11/cli.ts.
I tried I understand the security aspect of not allowing importing modules at runtime, but it's exactly what I'm trying to do. Like Tanstack Router, I want to run a command to load a module and extract stuff from the module. This use-case is legit. |
Beta Was this translation helpful? Give feedback.
-
@grenierdev Yeah, security is a big issue with this. A dependency could just import random files without the user even knowing it. Maybe this could be solved through an extra flag? Or make the user somehow aware of what files will be imported by which module. Since this works with "deno.land modules", I expected it to work with JSR as well. |
Beta Was this translation helpful? Give feedback.
-
I'm currently trying to migrate to JSR with deno 2.0. My package has dynamic imports like:
And after I published my package to JSR and tried to run it locally after installing it globally, I got this error:
It somehow tries to import it from JSR, despite having it marked as a local import. I don't know if this is a bug or expected behavior? I assume you can't dynamically import from a package installed from JSR? Seems limited to me. Might have to move away from deno as I don't want to reverse all my changes.
Anyone has a smiliar issue and figured it out? Would appreciate the help!
Beta Was this translation helpful? Give feedback.
All reactions