ERR_REQUIRE_ESM when launching Slice Machine (latest version)

Hello, I tried to launch Slice Machine from the latest version and I got the following error:

"Error [ERR_REQUIRE_ESM]: require() of ES Module /**/***/***/***/projectname/node_modules/.pnpm/@anthropic-ai+claude-agent-sdk@0.1.36_zod@3.25.76/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs not supported. Instead change the require of /**/***/***/***/projectname/node_modules/.pnpm/@anthropic-ai+claude-agent-sdk@0.1.36_zod@3.25.76/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs to a dynamic import() which is available in all CommonJS modules. at Module.<anonymous> (/**/***/***/***/projectname/node_modules/.pnpm/@slicemachine+manager@0.26.3_@prismicio+types@0.2.9_zod@3.25.76/node_modules/@slicemachine/manager/dist/managers/customTypes/CustomTypesManager.cjs:22:24) { code: 'ERR_REQUIRE_ESM' }"

Could you please help me resolve this issue? Despite my attempts, the problem still persists.

There is my package.json:

{

"name": "corpo",

"version": "0.1.0",

"type": "module",

"private": true,

"scripts": {

"dev": "next dev -p 8090 --turbopack",

"build": "next build --turbopack",

"slicemachine": "start-slicemachine"

  },

"dependencies": {

"@heroicons/react": "^2.2.0",

"@hookform/resolvers": "^5.1.1",

"@lottiefiles/react-lottie-player": "^3.6.0",

"@next/third-parties": "^15.5.3",

"@prismicio/client": "^7.20.1",

"@prismicio/helpers": "^2.3.9",

"@prismicio/next": "^2.0.1",

"@prismicio/react": "^3.2.1",

"@radix-ui/react-accordion": "^1.2.12",

"@radix-ui/react-avatar": "^1.1.10",

"@radix-ui/react-checkbox": "^1.3.2",

"@radix-ui/react-collapsible": "^1.1.11",

"@radix-ui/react-dialog": "^1.1.14",

"@radix-ui/react-dropdown-menu": "^2.1.15",

"@radix-ui/react-label": "^2.1.7",

"@radix-ui/react-navigation-menu": "^1.2.13",

"@radix-ui/react-popover": "^1.1.14",

"@radix-ui/react-radio-group": "^1.3.7",

"@radix-ui/react-select": "^2.2.5",

"@radix-ui/react-separator": "^1.1.7",

"@radix-ui/react-slot": "^1.2.3",

"@radix-ui/react-tabs": "^1.1.13",

"@radix-ui/react-tooltip": "^1.2.7",

"@remixicon/react": "^4.6.0",

"@repo/ui": "workspace:\*",

"@tanstack/react-query": "^5.90.1",

"@tanstack/react-query-devtools": "^5.90.2",

"axios": "^1.12.2",

"cmdk": "^1.1.1",

"date-fns": "^4.1.0",

"embla-carousel-react": "^8.6.0",

"framer-motion": "^12.23.19",

"i18next": "^25.5.2",

"js-cookie": "^3.0.5",

"libphonenumber-js": "^1.11.0",

"lucide-react": "^0.525.0",

"mapbox-gl": "^3.15.0",

"motion": "^12.23.6",

"next": "15.5.7",

"next-intl": "^4.3.9",

"next-mdx-remote": "^5.0.0",

"prop-types": "^15.8.1",

"react": "19.2.1",

"react-dom": "19.2.1",

"react-fast-marquee": "^1.6.5",

"react-hook-form": "^7.60.0",

"react-intersection-observer": "^9.16.0",

"react-map-gl": "^8.0.4",

"react-phone-number-input": "^3.4.12",

"remixicon": "^4.6.0",

"zod": "^3.25.67",

"zod-i18n-map": "^2.27.0"

  },

"devDependencies": {

"@repo/eslint-config": "workspace:\*",

"@repo/typescript-config": "workspace:\*",

"@slicemachine/adapter-next": "^0.3.93",

"@types/js-cookie": "^3.0.6",

"@types/node": "^20",

"@types/react": "^19",

"@types/react-dom": "^19",

"slice-machine-ui": "^2.20.5",

"typescript": "^5"

  }
}

Hey @prismic38, this error points to a third-party dependency (@anthropic-ai/claude-agent-sdk) and a Node.js module compatibility issue.

Slice Machine doesn’t depend on the Anthropic SDK directly. If that package is present in the project, it’s coming from your project setup or tooling, not from Prismic.

You could try checking whether removing or pausing that package lets Slice Machine run normally.

Hey @Pau I’m running into this error too, and this is what Cursor is outputting when I ask it to track down which package is loading the claude-agent-sdk. I only started running into the issue when I upgraded my Prismic packages today.

Thanks!

Hey everyone, thanks for reporting this, and sorry for the confusion here.

We’ve identified that recent Slice Machine releases now require Node.js ≥ 20.19.0.
If you’re running an older Node version, it can trigger the ERR_REQUIRE_ESM error you’re seeing (due to newer ESM-only dependencies in the toolchain).

What you can do right now

  • Check your Node version: node -v

  • Upgrade to Node 20.19.0+

We’re looking into embedding a proper runtime check + friendly error message directly when launching Slice Machine, so this fails fast with a clear explanation instead of a complex stack trace.

Thanks for your patience, and please reply in case upgrading Node doesn’t resolve it for you. :folded_hands:

Hey @xavier.rutayisire , thanks for getting back to me. I’ve just run node -v and I’m still seeing the error on Node 21.7.3.

Thanks!

Hi,

Thanks for checking, that helps a lot.

We can confirm the issue still occurs on Node 21. It looks like the require(esm) fix was only backported to Node 20 (the current LTS), but not to 21.

We likely missed this because our validation was done on Node ≥22, where it works as expected.

For now, Slice Machine works with:

  • Node 20.19.0+ (latest Node 20 LTS only)

  • Node 22+

If you can try again with one of those versions and let us know how it goes, that would be great.

Thanks.