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
If you run this it works fine, if you bundle and then run this it also works fine, but if you bundle it, then rename the folder containing the script, then run, it won't be able to find the dependency any more:
// use [email protected]
$ deno bundle --unstable source.ts > out.js
$ cd .. && mv deno deno2 &&cd deno2
$ deno run --allow-read --unstable out.js
error: Uncaught Error: Cannot find module 'isarray'
Require stack:
- /Users/julian/Desktop/deno/source.ts
const err = new Error(message10);
^
at Function._resolveFilename (file:///Users/julian/Desktop/deno2/out.js:16369:25)
at Function._load (file:///Users/julian/Desktop/deno2/out.js:16438:33)
at Module.require (file:///Users/julian/Desktop/deno2/out.js:16282:27)
at require1 (file:///Users/julian/Desktop/deno2/out.js:16916:21)
at file:///Users/julian/Desktop/deno2/out.js:16942:17
Also the error report will have both locations deno and deno2 mixed.
Would it be possible to either make this use relative paths, or even better, include node_modules in the bundle too?
The text was updated successfully, but these errors were encountered:
however could that create other issues in the long run?
No, it's most likely fine for your use case. If your Deno modules are being bundled together then you want them to act as the same referrer when requiring node modules. It won't make a difference if you're only using require() on node packages and not on relative project paths.
Do you think this is something that could be documented? It's now the second time that I had to replace import.meta.url with Deno.mainModule when using deno bundle.
Say you want to bundle a script that uses
node_modules
, like this:If you run this it works fine, if you bundle and then run this it also works fine, but if you bundle it, then rename the folder containing the script, then run, it won't be able to find the dependency any more:
Also the error report will have both locations
deno
anddeno2
mixed.Would it be possible to either make this use relative paths, or even better, include
node_modules
in the bundle too?The text was updated successfully, but these errors were encountered: