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
and the command deno run --no-check --allow-read --allow-write --allow-env --allow-run --allow-net esbuild.ts where main.ts is a file that imports tsmorph, like so:
> deno-cache:https://deno.land/x/ts_morph@10.0.2/common/typescript.js:17:21: warning: Top-level "this" will be replaced with undefined since this file is an ECMAScript module
17 │ var __spreadArray = (this && this.__spreadArray) || function (to...
╵ ~~~~
deno-cache:https://deno.land/x/ts_morph@10.0.2/common/typescript.js:153191:0: note: This file is considered an ECMAScript module because of the "export" keyword here
153191 │ export { ts };
╵ ~~~~~~
> deno-cache:https://deno.land/x/ts_morph@10.0.2/common/typescript.js:3689:33: error: [plugin: deno-cache] Not Found
3689 │ fs = require("fs");
╵ ~~~~
> deno-cache:https://deno.land/x/ts_morph@10.0.2/common/typescript.js:3421:33: error: [plugin: deno-cache] Not Found
3421 │ ... var _a = require("perf_hooks"), nodePerformance_1 = _a...
╵ ~~~~~~~~~~~~
> deno-cache:https://deno.land/x/ts_morph@10.0.2/common/typescript.js:7195:34: error: [plugin: deno-cache] Not Found
7195 │ _crypto = require("crypto");
╵ ~~~~~~~~
> deno-cache:https://deno.land/x/ts_morph@10.0.2/common/typescript.js:7190:32: error: [plugin: deno-cache] Not Found
7190 │ var _path = require("path");
╵ ~~~~~~
> deno-cache:https://deno.land/x/ts_morph@10.0.2/common/typescript.js:7302:32: error: [plugin: deno-cache] Not Found
7302 │ require("source-map-support").install();
╵ ~~~~~~~~~~~~~~~~~~~~
> deno-cache:https://deno.land/x/ts_morph@10.0.2/common/typescript.js:7350:40: error: [plugin: deno-cache] Not Found
7350 │ var inspector = require("inspector");
╵ ~~~~~~~~~~~
> deno-cache:https://deno.land/x/ts_morph@10.0.2/common/typescript.js:7191:30: error: [plugin: deno-cache] Not Found
7191 │ var _os = require("os");
╵ ~~~~
> deno-cache:https://deno.land/x/ts_morph@10.0.2/common/typescript.js:7203:33: error: [plugin: deno-cache] Not Found
7203 │ var Buffer = require("buffer").Buffer;
╵ ~~~~~~~~
�[0m�[1m�[31merror�[0m: Uncaught (in promise) Error: Build failed with 8 errors:
deno-cache:https://deno.land/x/ts_morph@10.0.2/common/typescript.js:3421:33: error: [plugin: deno-cache] Not Found
deno-cache:https://deno.land/x/ts_morph@10.0.2/common/typescript.js:3689:33: error: [plugin: deno-cache] Not Found
deno-cache:https://deno.land/x/ts_morph@10.0.2/common/typescript.js:7190:32: error: [plugin: deno-cache] Not Found
deno-cache:https://deno.land/x/ts_morph@10.0.2/common/typescript.js:7191:30: error: [plugin: deno-cache] Not Found
deno-cache:https://deno.land/x/ts_morph@10.0.2/common/typescript.js:7195:34: error: [plugin: deno-cache] Not Found
...
at �[0m�[1m�[3mfailureErrorWithLog�[0m (�[0m�[36mhttps://deno.land/x/esbuild@v0.11.17/mod.js�[0m:�[0m�[33m1398�[0m:�[0m�[33m15�[0m)
at �[0m�[36mhttps://deno.land/x/esbuild@v0.11.17/mod.js�[0m:�[0m�[33m1080�[0m:�[0m�[33m28�[0m
at �[0m�[1m�[3mrunOnEndCallbacks�[0m (�[0m�[36mhttps://deno.land/x/esbuild@v0.11.17/mod.js�[0m:�[0m�[33m876�[0m:�[0m�[33m47�[0m)
at �[0m�[1m�[3mbuildResponseToResult�[0m (�[0m�[36mhttps://deno.land/x/esbuild@v0.11.17/mod.js�[0m:�[0m�[33m1078�[0m:�[0m�[33m7�[0m)
at �[0m�[36mhttps://deno.land/x/esbuild@v0.11.17/mod.js�[0m:�[0m�[33m1185�[0m:�[0m�[33m14�[0m
at �[0m�[36mhttps://deno.land/x/esbuild@v0.11.17/mod.js�[0m:�[0m�[33m567�[0m:�[0m�[33m9�[0m
at �[0m�[1m�[3mhandleIncomingPacket�[0m (�[0m�[36mhttps://deno.land/x/esbuild@v0.11.17/mod.js�[0m:�[0m�[33m664�[0m:�[0m�[33m9�[0m)
at �[0m�[1m�[3mreadFromStdout�[0m (�[0m�[36mhttps://deno.land/x/esbuild@v0.11.17/mod.js�[0m:�[0m�[33m534�[0m:�[0m�[33m7�[0m)
at �[0m�[36mhttps://deno.land/x/esbuild@v0.11.17/mod.js�[0m:�[0m�[33m1663�[0m:�[0m�[33m11�[0m
here is the un-messed up version:
error: Uncaught (in promise) Error: Build failed with 8 errors:
deno-cache:https://deno.land/x/ts_morph@10.0.2/common/typescript.js:3421:33: error: [plugin: deno-cache] Not Found
deno-cache:https://deno.land/x/ts_morph@10.0.2/common/typescript.js:3689:33: error: [plugin: deno-cache] Not Found
deno-cache:https://deno.land/x/ts_morph@10.0.2/common/typescript.js:7190:32: error: [plugin: deno-cache] Not Found
deno-cache:https://deno.land/x/ts_morph@10.0.2/common/typescript.js:7191:30: error: [plugin: deno-cache] Not Found
deno-cache:https://deno.land/x/ts_morph@10.0.2/common/typescript.js:7195:34: error: [plugin: deno-cache] Not Found
...
at failureErrorWithLog (https://deno.land/x/esbuild@v0.11.17/mod.js:1398:15)
at https://deno.land/x/esbuild@v0.11.17/mod.js:1080:28
at runOnEndCallbacks (https://deno.land/x/esbuild@v0.11.17/mod.js:876:47)
at buildResponseToResult (https://deno.land/x/esbuild@v0.11.17/mod.js:1078:7)
at https://deno.land/x/esbuild@v0.11.17/mod.js:1185:14
at https://deno.land/x/esbuild@v0.11.17/mod.js:567:9
at handleIncomingPacket (https://deno.land/x/esbuild@v0.11.17/mod.js:664:9)
at readFromStdout (https://deno.land/x/esbuild@v0.11.17/mod.js:534:7)
at https://deno.land/x/esbuild@v0.11.17/mod.js:1663:11
I'm not sure what is going on here, but I know that tsmorph (compiles) imports correctly when I do deno compile src/main.ts, so I think this is not an issue with tsmorph being Deno incompatible.
The text was updated successfully, but these errors were encountered:
This is a known issue of Esbuild, not evaluating conditions or try...catch for require().
See evanw/esbuild#1132 and evanw/esbuild#1127.
This problem happens because Esbuild does not evaluate the code in the build time.
Esbuild will walys try to resolve the require, which in these cases don`t exist because they are Node internal modules.
I am using the Deno version of tsmorph. When I run the build, with the following script:
and the command
deno run --no-check --allow-read --allow-write --allow-env --allow-run --allow-net esbuild.ts
wheremain.ts
is a file that importstsmorph
, like so:I get the following errors:
here is the un-messed up version:
I'm not sure what is going on here, but I know that tsmorph (compiles) imports correctly when I do
deno compile src/main.ts
, so I think this is not an issue with tsmorph being Deno incompatible.The text was updated successfully, but these errors were encountered: