Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138163

How to load a javascript module in html

$
0
0

I receive an error whenever I import a library in my index.js file and try to use it in index.html file.

script tag in index.html: <script src="index.js" type="module"></script>

import statement in index.js: import axios from './node_modules/axios';

The error I receive: enter image description here

*I am running the app on a local server, not on the file system.


Viewing all articles
Browse latest Browse all 138163

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>