Open CristianPi opened 3 months ago
1.1.15+b23ba1fe1
Linux 6.9.4-200.fc40.x86_64 x86_64 unknown
just run the build with any dependency that use punycode/, like "mongodb": "6.7.0", bun build ./file.ts --outdir ./file-folder --target node
run the file, crash with
{ "errorType": "Runtime.ImportModuleError", "errorMessage": "Error: Cannot find module 'punycode/'\nRequire stack:\n- /var/task/index.mjs", "trace": [ "Runtime.ImportModuleError: Error: Cannot find module 'punycode/'", "Require stack:", "- /var/task/index.mjs", " at _loadUserApp (file:///var/runtime/index.mjs:1087:17)", " at async UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1119:21)", " at async start (file:///var/runtime/index.mjs:1282:23)", " at async file:///var/runtime/index.mjs:1288:1" ] }
to bundle the module punycode
i see a __require("punycode/");
No response
Hello @CristianPi. Please provide a minimal reproduction using a GitHub repository, Replit, or CodeSandbox. Issues marked with needs repro will be closed if they have no activity within 3 days.
needs repro
What version of Bun is running?
1.1.15+b23ba1fe1
What platform is your computer?
Linux 6.9.4-200.fc40.x86_64 x86_64 unknown
What steps can reproduce the bug?
just run the build with any dependency that use punycode/, like "mongodb": "6.7.0", bun build ./file.ts --outdir ./file-folder --target node
run the file, crash with
{ "errorType": "Runtime.ImportModuleError", "errorMessage": "Error: Cannot find module 'punycode/'\nRequire stack:\n- /var/task/index.mjs", "trace": [ "Runtime.ImportModuleError: Error: Cannot find module 'punycode/'", "Require stack:", "- /var/task/index.mjs", " at _loadUserApp (file:///var/runtime/index.mjs:1087:17)", " at async UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1119:21)", " at async start (file:///var/runtime/index.mjs:1282:23)", " at async file:///var/runtime/index.mjs:1288:1" ] }
What is the expected behavior?
to bundle the module punycode
What do you see instead?
i see a __require("punycode/");
Additional information
No response