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
Run the following command to build the npm package:
$ deno run -A scripts/build_npm.ts 0.1.0
Expected
dist/esm/test.js
exportconst_internals={prompt: dntShim.prompt,};
Actual
Build failed with following code and an error.
dist/esm/test.js
exportconst_internals={
dntShim, : .prompt,};
Error message
[dnt] Transforming...
[dnt] Running npm install...
added 1 package, and audited 3 packages in 2s
found 0 vulnerabilities
[dnt] Building project...
[dnt] Emitting ESM package...
[dnt] Running tests...
> package_name@0.1.0 test
> node test_runner.js
Running tests in ./esm/test.js...
file:///tmp/tmp.j8gohGBMqN/dist/esm/test.js:3
dntShim, : .prompt,
^
SyntaxError: Unexpected token ':'
at ESMLoader.moduleStrategy (node:internal/modules/esm/translators:119:18)
at ESMLoader.moduleProvider (node:internal/modules/esm/loader:468:14)
at async link (node:internal/modules/esm/module_job:68:21)
Node.js v18.14.2
error: Uncaught (in promise) Error: npm run test failed with exit code 1
throw new Error(
^
at runCommand (https://deno.land/x/dnt@0.38.0/lib/utils.ts:56:13)
at eventLoopTick (ext:core/01_core.js:183:11)
at async build (https://deno.land/x/dnt@0.38.0/mod.ts:407:5)
at async file:///tmp/tmp.j8gohGBMqN/scripts/build_npm.ts:3:1
Workaround
There is a workaround for this problem. It is to not use the short-hand format.
src/test.ts
exportconst_internals={prompt: prompt,};
will result in expected output.
The text was updated successfully, but these errors were encountered:
Description
When compiling a following program that supports ES module, an invalid objects is generated.
To reproduce
src/tests.ts
andscripts/build_npm.ts
.src/test.ts
scripts/build_npm.ts
Run the following command to build the npm package:
Expected
dist/esm/test.js
Actual
Build failed with following code and an error.
dist/esm/test.js
Error message
Workaround
There is a workaround for this problem. It is to not use the short-hand format.
src/test.ts
will result in expected output.
The text was updated successfully, but these errors were encountered: