I am making a website and I am trying to import a script. Whenever I try to import the script I get Uncaught SyntaxError: Unexpected token '{' . I am using express to show the website and it is just returning a html file.
This is the script tag that I am using to access the main script.
<script type="module" src="./main.js" defer>
This is the code in the main file
.then(function(data) {
data.forEach(function(currentdevice) {
import { testvalue } from "./DeviceManager/" + currentdevice.Type;
});
Basically currentdevice.Type is the file name and I checked it is correct.
For the file that I am trying to import I just have a bit of example code why I try to get import to work.
export const testvalue = 'test';
I have looked on google and I was unable to personally find anything.