Open youth95 opened 1 month ago
It seems that the issue arises from using require('axios/dist/node/axios.cjs')
, which is not supported in the latest version of Node.js due to the way exports are defined in the axios
package. The error you're seeing is related to subpath exports not being exposed in axios.
Node: 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
For context, bun build
tries to bundle every import, assuming they’ll be needed. In a normal runtime, this import wouldn’t be encountered, but during the build process, Bun attempts to bundle it and encounters this issue.
Unfortunately, since this isn't your code, there's not much you can do besides patching the axios
package.json or your library. You can patch it using bun patch
.
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