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
{{ message }}
Repository navigation
Error "Must use import to load ES Module" when using es6 modules #90
Application has thrown an uncaught exception and is terminated:
Error: Cannot find module 'esm'
Require stack:
- D:\wwwroot\sites\...\server.js
- C:\Program Files\iisnode\interceptor.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1039:15)
at Module._load (node:internal/modules/cjs/loader:885:27)
at Module.require (node:internal/modules/cjs/loader:1105:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object.<anonymous> (D:\wwwroot\sites\IFJ-Levante-App2\server.js:1:11)
at Module._compile (node:internal/modules/cjs/loader:1218:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
at Module.load (node:internal/modules/cjs/loader:1081:32)
at Module._load (node:internal/modules/cjs/loader:922:12)
at Module.require (node:internal/modules/cjs/loader:1105:19)
Activity
patrickgalbraith commentedon Dec 9, 2020
Having this problem as well.
patrickgalbraith commentedon Dec 10, 2020
I managed to fix this issue by using the
esmmodule. I created aserver.jsfile which I reference from theweb.configlike this:In this example
app.jsis an ES module.Ben555555 commentedon Nov 20, 2024
Patrick Galbraith (@patrickgalbraith)
I'm still getting the following exception: