axios
axios copied to clipboard
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/helpers/buildURL.js' is not defined by "exports"
Describe the bug
After upgrading from version 0.27.2
to 1.1.3
I've faced with the error:
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/helpers/buildURL.js' is not defined by "exports" in /test/node_modules/axios/package.json imported from /test/request.js
To Reproduce
- Install axios version 1+
- Try to import any helper
Code snippet
import buildURL from 'axios/lib/helpers/buildURL.js';
import combineURLs from 'axios/lib/helpers/combineURLs.js';
Expected behavior
Helpers imported as it was in pre 1.0 version.
Axios Version
1.1.3
Adapter Version
Browser
Browser Version
Node.js Version
v16.16.0
OS
macOS
Additional Library Versions
Project is in ESM module format `"type": "module",`.
Additional context/Screenshots
No response
Related issues:
- https://github.com/axios/axios/issues/5183
- https://github.com/axios/axios/issues/5072
Can we have an update please?
Issue still occurs, can someone give any updates on this ?
I was checking maybe the problem is with NodeJS version, or with Next version or other libraries but it seems like smth happen here
or maybe in other module that uses buildURL function.
Would be great to know whether there are at least some advices for that, as since 0.28.1 here we have a problem from Snyk:
- Prototype Pollution in which is fixed in 1.6.4, found in [email protected] and [email protected]
- Cross-site Request Forgery (CSRF) found in [email protected] and [email protected]
- Regular Expression Denial of Service (ReDoS) found in [email protected] and [email protected]
All of those are fixed in 1.6.0, 1.6.3 and 1.6.4, but with 1.6.4 or later same issue exists:
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/helpers/buildURL' is not defined by "exports" in /Users/romanblyztsiv/Documents/departmentstore-edge/node_modules/axios/package.json at new NodeError (node:internal/errors:405:5) at exportsNotFound (node:internal/modules/esm/resolve:261:10) at packageExportsResolve (node:internal/modules/esm/resolve:591:9) at resolveExports (node:internal/modules/cjs/loader:547:36) at Function.Module._findPath (node:internal/modules/cjs/loader:621:31) at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1034:27) at Function.call (/Users/romanblyztsiv/Documents/departmentstore-edge/node_modules/@cspotcode/source-map-support/source-map-support.js:811:30) at /Users/romanblyztsiv/Documents/departmentstore-edge/node_modules/next/src/server/require-hook.ts:50:34 at Function.Module._load (node:internal/modules/cjs/loader:901:27) at Module.require (node:internal/modules/cjs/loader:1115:19) { code: 'ERR_PACKAGE_PATH_NOT_EXPORTED' }