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
modern dev
Modern.js Framework v2.68.14
start build started...
error Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: xxx\config\mock\index.ts
require() of ES modules is not supported.
require() of xxx\config\mock\index.ts from xxx\node_modules\.pnpm\@[email protected]_@_339c3420e0c59a1e0226dbe15a916586\node_modules\@modern-js\server\dist\cjs\helpers\mock.js is an ES module file as it is a .ts file whose nearest parent package.json contains "type": "module" which defines all .ts files in that package scope as ES modules.
Instead change the requiring code to use import(), or remove "type": "module" from xxx\package.json.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I create mock file in
config\mock\index.cjs
, content:packge.json add
"type": "module"
tsconfig.json add
when I run
dev
command, the console shows:Beta Was this translation helpful? Give feedback.
All reactions