Quantcast
Channel: Cannot use import statement outside a module(Vanilla Javascript) - Stack Overflow
Viewing all articles
Browse latest Browse all 4

Answer by Bravo Stack for Cannot use import statement outside a module(Vanilla Javascript)

$
0
0

First off, you have to include the type="module" attribute in your script tag.

Secondly, when using the import statement, don't leave out the file extension, in this case .js.e.g: import { sqrRoot } from "./math_function.js"


Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images