You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When i try to use a import statement inside a module, i get the following error:
evalmachine.<anonymous>:1
import { activateElement, deactivateElement } from './utils/utils.js';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at new Script (node:vm:100:7)
at createScript (node:vm:265:10)
at Object.runInContext (node:vm:296:10)
at Window.eval /node_modules/happy-dom/lib/window/Window.js:366:33)
at Function.loadExternalScript (/node_modules/happy-dom/lib/nodes/html-script-element/ScriptUtility.js:69:51)
at HTMLScriptElement._connectToNode (/node_modules/happy-dom/lib/nodes/html-script-element/HTMLScriptElement.js:177:41)
at HTMLElement._connectToNode (/node_modules/happy-dom/lib/nodes/node/Node.js:435:23)
at HTMLElement._connectToNode (/node_modules/happy-dom/lib/nodes/node/Node.js:435:23)
at HTMLDocument.appendChild (/node_modules/happy-dom/lib/nodes/node/Node.js:249:14)
at HTMLDocument.appendChild (/node_modules/happy-dom/lib/nodes/document/Document.js:486:22)
The script tag is defined as following: <script src="/scripts/global.js" type="module"></script>
I'm using Happy Dom version 7.4.0, but the problem also occurred in 6.0.4. My Node.js version is 16.17.0.
The text was updated successfully, but these errors were encountered:
When i try to use a import statement inside a module, i get the following error:
The script tag is defined as following:
<script src="/scripts/global.js" type="module"></script>
I'm using Happy Dom version 7.4.0, but the problem also occurred in 6.0.4. My Node.js version is 16.17.0.
The text was updated successfully, but these errors were encountered: