ESM issue 😬
See original GitHub issueError [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/kud/Projects/_kud/diary/node_modules/react-children-utilities/react-children-utilities.js
require() of ES modules is not supported.
require() of /Users/kud/Projects/_kud/diary/node_modules/react-children-utilities/react-children-utilities.js from /Users/kud/Projects/_kud/diary/.next/server/static/development/pages/_app.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 react-children-utilities.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /Users/kud/Projects/_kud/diary/node_modules/react-children-utilities/package.json.
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1192:13)
at Module.load (internal/modules/cjs/loader.js:1040:32)
at Function.Module._load (internal/modules/cjs/loader.js:929:14)
at Module.require (internal/modules/cjs/loader.js:1080:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.react-children-utilities (/Users/kud/Projects/_kud/diary/.next/server/static/development/pages/_app.js:1528:18)
at __webpack_require__ (/Users/kud/Projects/_kud/diary/.next/server/static/development/pages/_app.js:23:31)
at Module../src/lib/get-reading-time.js (/Users/kud/Projects/_kud/diary/.next/server/static/development/pages/_app.js:1017:82)
at __webpack_require__ (/Users/kud/Projects/_kud/diary/.next/server/static/development/pages/_app.js:23:31)
at Module../src/components/Layout/Post/index.js (/Users/kud/Projects/_kud/diary/.next/server/static/development/pages/_app.js:355:79)
at __webpack_require__ (/Users/kud/Projects/_kud/diary/.next/server/static/development/pages/_app.js:23:31)
at Module../src/pages/_app.js (/Users/kud/Projects/_kud/diary/.next/server/static/development/pages/_app.js:1075:82)
at __webpack_require__ (/Users/kud/Projects/_kud/diary/.next/server/static/development/pages/_app.js:23:31)
at Object.0 (/Users/kud/Projects/_kud/diary/.next/server/static/development/pages/_app.js:1395:18)
at __webpack_require__ (/Users/kud/Projects/_kud/diary/.next/server/static/development/pages/_app.js:23:31)
at /Users/kud/Projects/_kud/diary/.next/server/static/development/pages/_app.js:91:18 {
code: 'ERR_REQUIRE_ESM'
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:21 (10 by maintainers)
Top Results From Across the Web
Wes Bos on Twitter: "Anyone using the esm package with ...
I've rolled back gatsby, esm and node and it still has the issue ... Ah, yes, my patch might have broken this 😬...
Read more >MR - Reply to a comment doesn't show the editor (#273005) · Issues ...
When replying to an MR comment, the text filed disappear. Steps to reproduce. We don't have proper steps to reproduce. This happens with...
Read more >Jon C.'s Post - LinkedIn
Why should #ITSM and #ESM Leaders consider IFS assyst? ... What's easy: 'That's not in my job description' 😬 What's hard: Taking on...
Read more >emoji-emotion - NPM Package Overview - Socket.dev
import {emojiEmotion} from 'https://esm.sh/emoji-emotion@3' ... Socket installs a Github app to automatically flag issues on every pull ...
Read more >Module Constraints - Remix
So what's the problem? ... db"; //😬 console.log(prisma); //🥶 export function meta() { return { title: "Posts" }; } export default function Posts()...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, you can use
next-transpile-modules
.I couldn’t get it to work with next.js even with the solution above but it turns out I misunderstood the solution above, my bad 😅