-
-
Notifications
You must be signed in to change notification settings - Fork 11k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CDN import: TypeError: Cannot set property 'axios' of undefined #1861
Comments
It works for me. What is the output of the following log statement?
Can you share all of the relevant code? |
It is due to the global
|
I am getting the same error, it seems the problem is with webpack configuration: https://stackoverflow.com/a/58990831/5922757 Should possibly fix the issue with undefined How to reproduce:
<html lang="en">
<body>
<script type="module">
import {} from "./axios.js";
</script>
</body>
</html>
You should see the following error:
|
This should solve the issue of undefined `this` when importing from an ES6 module. I've put steps to reproduce in [this comment](axios#1861 (comment)).
same here. I wanted to use axios for tampermonkey but the require statement not working, for the error message |
Why is the issue closed when the bug is clearly reproducible and there is no proper fix even in the comments? |
This should solve the issue of undefined `this` when importing from an ES6 module. I've put steps to reproduce in [this comment](#1861 (comment)). Co-authored-by: Jay <jasonsaayman@gmail.com>
This should solve the issue of undefined `this` when importing from an ES6 module. I've put steps to reproduce in [this comment](axios#1861 (comment)). Co-authored-by: Jay <jasonsaayman@gmail.com>
…ive fetch api issue : axios/axios#1861
This should solve the issue of undefined `this` when importing from an ES6 module. I've put steps to reproduce in [this comment](axios/axios#1861 (comment)). Co-authored-by: Jay <jasonsaayman@gmail.com>
This should solve the issue of undefined `this` when importing from an ES6 module. I've put steps to reproduce in [this comment](axios/axios#1861 (comment)). Co-authored-by: Jay <jasonsaayman@gmail.com>
I'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
The text was updated successfully, but these errors were encountered: