Open guest271314 opened 4 days ago
Pardon, using node without the run, which triggered CommonJS loader
node --no-warnings test.js
file:///home/user/bin/swc-typescript.js:6
imports["__wbindgen_placeholder__"] = exports_wasm;
^
ReferenceError: exports_wasm is not defined
at file:///home/user/bin/swc-typescript.js:6:39
at ModuleJob.run (node:internal/modules/esm/module_job:271:25)
at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:547:26)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:116:5)
Node.js v24.0.0-nightly20241031996708042b
Smaller reproduction:
// a.ts
let result = module.exports;
module.exports.getExports = () => result;
bun build a.ts
// a.ts
var result = exports_a;
var $getExports = () => result;
export {
$getExports as getExports
};
What version of Bun is running?
1.1.34-canary.40+693320879
What platform is your computer?
Linux 5.15.0-43-generic x86_64 x86_64
What steps can reproduce the bug?
What is the expected behavior?
The bundled script to work as expected.
What do you see instead?
test.js
Additional information
The issue in code
@swc/wasm-typescript/wasm.js
swc-typescript.js
exports_wasm
is undefined.