cannot read property defaults of undefined
See original GitHub issuewith the following…
import axios from 'axios';
import MockAdapter from 'axios-mock-adapter';
const mockAdapter = new MockAdapter(axios);
global.axios = mockAdapter;
I’m getting the cannot read property defaults of undefined, I’ve tried all alternative import methods and still get the same result. Am I missing something?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (1 by maintainers)
Top Results From Across the Web
DataTables: Uncaught TypeError: Cannot read property ...
Uncaught TypeError : Cannot read property 'defaults' of undefined (dataTables.bootstrap.js:20). This causes the pagination controls to not ...
Read more >Uncaught TypeError: Cannot read property ... - DataTables
i am using datatable with this i am facing that error because of that i can not load data table properly because of...
Read more >Uncaught TypeError: Cannot read property 'defaults ... - GitHub
It look like you created custom javascript, and I would guess you placed it before jquery or jQuery is not loaded correctly.
Read more >cannot read properties of undefined (reading 'defaults')
Uncaught TypeError : Cannot read property 'defaults' of undefined (dataTables.bootstrap.js:20) This causes the pagination controls to not have styles on them. I ...
Read more >After cloning i am getting this console error?why?any solution?
... Uncaught TypeError: Cannot read property 'defaults' of undefined ... read our Cookie Policy and visit our Cookie Preference Manager.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

In my case I had jest.mock(axios) in test file, removed it and now works as expected
I have the same problem, any solution ?