Issue 1:
Describe the bug

import axios, { AxiosInstance, AxiosResponse } from 'axios'

...

this.instance = axios.create( {
^

TypeError: Cannot read properties of undefined (reading 'create')

To Reproduce

No response

Code snippet

No response

Expected behavior

No response

Axios Version

1.1.3

Adapter Version

No response

Browser

No response

Browser Version

No response

Node.js Version

19

OS

No response

Additional Library Versions

No response

Additional context/Screenshots

No response

Issue 2:
Describe the bug

I recently updated from 0.27.2 to 1.1.3 and now my tests are failing. When there's a test mounting a component which contains an axios import, the test fails.

The output is the following:

$ federicontr@laptop axios-test % CI=true yarn test
yarn run v1.22.19
$ react-scripts test
FAIL src/App.test.js
● Test suite failed to run

Jest encountered an unexpected token

Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.

Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.

By default "node_modules" folder is ignored by transformers.

Here's what you can do:
• If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
• If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript
• To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
• If you need a custom transformation specify a "transform" option in your config.
• If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

You'll find more details and examples of these config options in the docs:
https://jestjs.io/docs/configuration
For information about custom transformations, see:
https://jestjs.io/docs/code-transformation

Details:

/Users/federicontr/Documents/redacted/axios-test/node_modules/axios/index.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){import axios from './lib/axios.js';
^^^^^^

SyntaxError: Cannot use import statement outside a module

1 | import logo from './logo.svg';
2 | import './App.css';
> 3 | import axios from 'axios';
| ^
4 |
5 | function App() {
6 | return (

at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1728:14)
at Object.<anonymous> (src/App.js:3:1)

Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 0.471 s
Ran all test suites.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

To Reproduce

Just create a new create-react-app project, add axios to it, import axios in App.js and then execute the test.

Code snippet

No response

Expected behavior

Tests running fine. If there's some change to be made it should be stated in the release notes or in the upgrade guide, which is very outdated.

Axios Version

1.1.3

Adapter Version

No response

Browser

No response

Browser Version

No response

Node.js Version

16.18.0

OS

macOS 12.6.1 and Ubuntu 20.04

Additional Library Versions

React 18.2.0

Additional context/Screenshots

No response