Open youth95 opened 3 hours ago
Latest node doesn't support the require('axios/dist/node/axios.cjs');
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './dist/node/axios.cjs' is not defined by "exports" in C:\bun-repos\14509\node_modules\axios\package.json
And also if you make bun runtime run it outside the try catch, it will fail too. So you should remove this catch import as you will only be using bun here and then it won't have to try to import.
If you can modify the code and need to have this, you can use --define with a check to make bun not bother:
if (!process.versions.bun)
axios = require('axios/dist/node/axios.cjs');
$ bun build path/to/main.ts --compile --target=bun-linux-x64 --outfile=app --minify --sourcemap --define process.versions.bun=true
What version of Bun is running?
1.1.31
What platform is your computer?
Darwin 23.5.0 arm64 arm
What steps can reproduce the bug?
some code in my dependencies packages look like this:
when i run this command:
i had an error:
is it not supported
require('path/to/file.cjs')
whenbun build
to dependencies analysis ?thank you
What is the expected behavior?
No response
What do you see instead?
No response
Additional information
No response