<h3 dir="auto">Describe the bug</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import axios, { AxiosInstance, AxiosResponse } from 'axios'

...

this.instance = axios.create( {
                        ^"><pre class="notranslate"><code class="notranslate">import axios, { AxiosInstance, AxiosResponse } from 'axios'

...

this.instance = axios.create( {
                        ^
</code></pre></div>
<p dir="auto"><code class="notranslate">TypeError: Cannot read properties of undefined (reading 'create')</code></p>
<h3 dir="auto">To Reproduce</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Code snippet</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Axios Version</h3>
<p dir="auto">1.1.3</p>
<h3 dir="auto">Adapter Version</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Browser</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Browser Version</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Node.js Version</h3>
<p dir="auto">19</p>
<h3 dir="auto">OS</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Additional Library Versions</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Additional context/Screenshots</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Describe the bug</h3>
<p dir="auto">I recently updated from <code class="notranslate">0.27.2</code> to <code class="notranslate">1.1.3</code> and now my tests are failing. When there's a test mounting a component which contains an axios import, the test fails.</p>
<p dir="auto">The output is the following:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ 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 &quot;node_modules&quot; 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 &quot;node_modules&quot; files transformed, you can specify a custom &quot;transformIgnorePatterns&quot; in your config.
     • If you need a custom transformation specify a &quot;transform&quot; 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 &quot;moduleNameMapper&quot; 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
    ({&quot;Object.&lt;anonymous&gt;&quot;: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';
    &gt; 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.&lt;anonymous&gt; (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.        "><pre class="notranslate">$ federicontr@laptop axios-test % CI=true yarn <span class="pl-c1">test</span>
yarn run v1.22.19                                                                                                                                                                                                                  
$ react-scripts <span class="pl-c1">test</span>                                                                                                                                                                                                               
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 <span class="pl-s"><span class="pl-pds">"</span>node_modules<span class="pl-pds">"</span></span> folder is ignored by transformers.

    Here<span class="pl-s"><span class="pl-pds">'</span>s what you can do:</span>
<span class="pl-s">     • If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.</span>
<span class="pl-s">     • If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript</span>
<span class="pl-s">     • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.</span>
<span class="pl-s">     • If you need a custom transformation specify a "transform" option in your config.</span>
<span class="pl-s">     • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.</span>
<span class="pl-s"></span>
<span class="pl-s">    You<span class="pl-pds">'</span></span>ll find more details and examples of these config options <span class="pl-k">in</span> 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
    ({<span class="pl-s"><span class="pl-pds">"</span>Object.&lt;anonymous&gt;<span class="pl-pds">"</span></span>:function(module,exports,require,__dirname,__filename,jest){import axios from <span class="pl-s"><span class="pl-pds">'</span>./lib/axios.js<span class="pl-pds">'</span></span><span class="pl-k">;</span>
                                                                                      ^^^^^^

    SyntaxError: Cannot use import statement outside a module

      1 <span class="pl-k">|</span> import logo from <span class="pl-s"><span class="pl-pds">'</span>./logo.svg<span class="pl-pds">'</span></span><span class="pl-k">;</span>
      2 <span class="pl-k">|</span> import <span class="pl-s"><span class="pl-pds">'</span>./App.css<span class="pl-pds">'</span></span><span class="pl-k">;</span>
    <span class="pl-k">&gt;</span> 3 <span class="pl-k">|</span> import axios from <span class="pl-s"><span class="pl-pds">'</span>axios<span class="pl-pds">'</span></span><span class="pl-k">;</span>
        <span class="pl-k">|</span> ^
      4 <span class="pl-k">|</span>
      5 <span class="pl-k">|</span> <span class="pl-k">function</span> <span class="pl-en">App()</span> {
      6 <span class="pl-k">|</span>   <span class="pl-k">return</span> (

      at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1728:14)
      at Object.<span class="pl-k">&lt;</span>anonymous<span class="pl-k">&gt;</span> (src/App.js:3:1)

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        0.471 s
Ran all <span class="pl-c1">test</span> suites.
error Command failed with <span class="pl-c1">exit</span> code 1.                                                                                                                                                                                             
info Visit https://yarnpkg.com/en/docs/cli/run <span class="pl-k">for</span> documentation about this command.        </pre></div>
<h3 dir="auto">To Reproduce</h3>
<p dir="auto">Just create a new <code class="notranslate">create-react-app</code> project, add axios to it, import axios in <code class="notranslate">App.js</code> and then execute the test.</p>
<h3 dir="auto">Code snippet</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">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.</p>
<h3 dir="auto">Axios Version</h3>
<p dir="auto">1.1.3</p>
<h3 dir="auto">Adapter Version</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Browser</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Browser Version</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Node.js Version</h3>
<p dir="auto">16.18.0</p>
<h3 dir="auto">OS</h3>
<p dir="auto">macOS 12.6.1 and Ubuntu 20.04</p>
<h3 dir="auto">Additional Library Versions</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="React 18.2.0"><pre class="notranslate">React 18.2.0</pre></div>
<h3 dir="auto">Additional context/Screenshots</h3>
<p dir="auto"><em>No response</em></p>