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
and I have imported like import "express-async-errors"; this
ReferenceError: require is not defined in ES module scope, you can use import instead
at file:///Users/admin/Documents/Ashwanee/node-app/node_modules/express-async-errors/index.js:1:15
at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
at async loadESM (node:internal/process/esm_loader:34:7)
at async handleMainPromise (node:internal/modules/run_main:113:12)
The text was updated successfully, but these errors were encountered:
This is my start script in package.json
"start": "node --watch --no-warnings=ExperimentalWarning --loader @swc-node/register/esm src/index.ts",
and I have imported like
import "express-async-errors";
thisReferenceError: require is not defined in ES module scope, you can use import instead
at file:///Users/admin/Documents/Ashwanee/node-app/node_modules/express-async-errors/index.js:1:15
at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
at async loadESM (node:internal/process/esm_loader:34:7)
at async handleMainPromise (node:internal/modules/run_main:113:12)
The text was updated successfully, but these errors were encountered: