You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The intent was to read a file from their machine as part of a script that builds an application. What I found was after switching from deno.land/x to jsr.io, how that resolves is different. It would end up resolving as if the path was relative to the jsr.io link to the package instead of the file on the machine running the script.
If the behavior of preventing imports of local files is intentional and this workaround is a bug, is there a proper way of enabling a script on jsr.io from dynamically importing from a file on the users machine? The intent is to access a file that defines a route to determine how to include it in the build that my script is generating.
Edit: I ended up changing my script to no longer need to dynamically import the file.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
When I was publishing one of my modules, I was running into issues with one of my scripts. I found an issue with file path imports.
Originally I had the following:
https://jsr.io/@udibo/react-app/0.20.1/build.ts#L201
The intent was to read a file from their machine as part of a script that builds an application. What I found was after switching from deno.land/x to jsr.io, how that resolves is different. It would end up resolving as if the path was relative to the jsr.io link to the package instead of the file on the machine running the script.
I tried fixing that by adding a "file://" prefix. When I published that change, I found it was transforming my code.
https://jsr.io/@udibo/react-app/0.20.2/build.ts#L201
The original code before publishing was the following:
So it seems that the publish command is just replacing it.
I did find a workaround to allow me to read from the local file. The following works and allows me to read the local file.
https://jsr.io/@udibo/react-app/0.21.0/build.ts#L202
If the behavior of preventing imports of local files is intentional and this workaround is a bug, is there a proper way of enabling a script on jsr.io from dynamically importing from a file on the users machine? The intent is to access a file that defines a route to determine how to include it in the build that my script is generating.
Edit: I ended up changing my script to no longer need to dynamically import the file.
The text was updated successfully, but these errors were encountered: