Error importing/exporting JS files?

Hello, I'm having trouble importing another JS file. I keep getting the error message that the function wasn't imported. Can someone help me?

https://paste.laschinsky.eu/ikapevayog.js

https://paste.laschinsky.eu/ewewomuwir.js

(1 votes)
Loading...

Similar Posts

Subscribe
Notify of
1 Answer
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
regex9
1 year ago

Probably the import path is not correct. It goes from the location of the JavaScript file that imports it.

Example:

index.html:


Example  

js/main.js:

import { sayHello } from "./modules/sayHello.js";

sayHello();

js/modules/sayHello.js:

export function sayHello() { alert("Hello"); }