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 trying to use ky/ky-universal with the newly created Next.js app receive such error:
Error: Must use import to load ES Module: /Users/---/node_modules/ky-universal/index.js
require() of ES modules is not supported.
require() of /---/node_modules/ky-universal/index.js from /---/.next/server/pages/index.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename /---/node_modules/ky-universal/index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /---/node_modules/ky-universal/package.json.
When trying to use ky/ky-universal with the newly created Next.js app receive such error:
Error: Must use import to load ES Module: /Users/---/node_modules/ky-universal/index.js
require() of ES modules is not supported.
require() of /---/node_modules/ky-universal/index.js from /---/.next/server/pages/index.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename /---/node_modules/ky-universal/index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /---/node_modules/ky-universal/package.json.
Packages version:
Node 14.15.4,
"dependencies": {
"ky": "^0.26.0",
"ky-universal": "^0.9.1",
"next": "10.0.5",
"react": "17.0.1",
"react-dom": "17.0.1"
}
Code extract
The text was updated successfully, but these errors were encountered: