Can't import cjs
envgap__axios__axios-5358
01 / FAILURE SIGNATURE
As reported upstream
[dev] Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './dist/browser/axios.cjs' is not defined by "exports" in /Users/jjohn/www/grate-cms/node_modules/axios/package.json
Not a benchmark task.
- The project already builds and runs before the fix, so there is nothing to repair.
02 / ENVIRONMENT RECIPE
- Base commit
6d84189349c43b1dcdd977b522610660cc4c7042- Manifest
package.json- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
axios/axios #5358 · read the original issue
### Describe the bug
Docs say you can import cjs with `const axios = require('axios/dist/browser/axios.cjs');`
This result in:
```
[dev] internal/modules/cjs/loader.js:430
[dev] throw e;
[dev] ^
[dev]
[dev] Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './dist/browser/axios.cjs' is not defined by "exports" in /Users/jjohn/www/grate-cms/node_modules/axios/package.json
[dev] at throwExportsNotFound (internal/modules/esm/resolve.js:299:9)
[dev] at packageExportsResolve (internal/modules/esm/resolve.js:522:3)
[dev] at resolveExports (internal/modules/cjs/loader.js:424:36)
[dev] at Function.Module._findPath (internal/modules/cjs/loader.js:464:31)
[dev] at Function.Module._resolveFilename (internal/modules/cjs/loader.js:802:27)
[dev] at Function.Module._load (internal/modules/cjs/loader.js:667:27)
[dev] at Module.require (internal/modules/cjs/loader.js:887:19)
[dev] at require (internal/modules/cjs/helpers.js:74:18)
[dev] at Object.<anonymous> (/Users/jjohn/www/grate-cms/src/server/env.js:4:15)
[dev] at Module._compile (internal/modules/cjs/loader.js:999:30) {
[dev] code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
[dev] }
```
### To Reproduce
`const axios = require('axios/dist/browser/axios.cjs');`
### Code snippet
```js
`const axios = require('axios/dist/browser/axios.cjs');`
```
### Expected behavior
No error, works.
### Axios Version
1.1.3
### Adapter Version
_No response_
### Browser
_No response_
### Browser Version
n/a
### Node.js Version
v12.22.12
### OS
_No response_
### Additional Library Versions
_No response_
### Additional context/Screenshots
_No response_04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]