CDN import: TypeError: Cannot set property 'axios' of undefined
See original GitHub issueI’m trying to use axios CDN with dynamic import ES6 ,
My code
(async ()=>{ await import('https://unpkg.com/axios/dist/axios.min.js') })()
Error
It works fine with System.import , but not with native import,
Context
- axios version: v0.18.0
- Environment: chrome 70, windows 10
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Uncaught TypeError: Cannot set property 'axios' of undefined
Try adding the axios to the Vue instance. Read this for more details https://v2.vuejs.org/v2/cookbook/adding-instance-properties.html.
Read more >cannot set properties of undefined (setting 'axios') - You.com
My code. (async ()=>{ await import('https://unpkg.com/axios/dist/axios.min.js') })() ; Error. axios_type_error. It works fine with System.import , but not with ...
Read more >axios - npm
Start using axios in your project by running `npm i axios`. ... `true` - ignore JSON parsing errors and set response.data to null...
Read more >cannot read properties of undefined react
Cannot read property 'setState' of undefined in react) TypeError: Cannot read ... import { useEffect, useState } from ' react'; import axios from...
Read more >Typeerror: cannot read property '_id' of undefined - CodeProject
TypeError : Cannot read property '_id' of undefined at ... import { useEffect, useState } from 'react'; import axios from 'axios'; ...
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 FreeTop 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
Top GitHub Comments
Why is the issue closed when the bug is clearly reproducible and there is no proper fix even in the comments?
I just test it independently, this is the execution result on the console