Shopify app dev command fails with ERR_REQUIRE_ESM

I have reproduced the issue on the latest CLI version.

Yes, I am on the latest version

I have searched existing posts and this report is not a duplicate.

Yes, this isn’t a duplicate

In which of these areas are you experiencing a problem?

App

Expected behavior

shopify app dev works as expected

Actual behavior

shopify app dev fails with error:

Error coming from npm exec react-router dev

Command failed with exit code 1: npm exec react-router dev
failed to load config from
/Users/samt/Documents/Sites/simple-upsell-app3/vite.config.ts
Error [ERR_REQUIRE_ESM]: require() of ES Module
/Users/samt/Documents/Sites/simple-upsell-app3/node_modules/p-map/index.js from
/Users/samt/Documents/Sites/simple-upsell-app3/node_modules/@react-router/dev/di
st/vite.js not supported.
Instead change the require of index.js in /Users/samt/Documents/Sites/simple-ups
ell-app3/node_modules/@react-router/dev/dist/vite.js to a dynamic import() which
is available in all CommonJS modules.
at Object. (/Users/samt/Documents/Sites/simple-upsell-app3/node_m
odules/@react-router/dev/dist/vite.js:62:28) {
code: β€˜ERR_REQUIRE_ESM’
}

Reproduction steps

npm install -g @shopify/cli@latest
shopify app init
… create new React Router Typescript app
cd simple-upsell-app3
shopify app dev

Verbose output

Command failed with exit code 1: npm exec react-router dev
failed to load config from
/Users/samt/Documents/Sites/simple-upsell-app3/vite.config.ts
Error [ERR_REQUIRE_ESM]: require() of ES Module
/Users/samt/Documents/Sites/simple-upsell-app3/node_modules/p-map/index.js from
/Users/samt/Documents/Sites/simple-upsell-app3/node_modules/@react-router/dev/di
st/vite.js not supported.
Instead change the require of index.js in /Users/samt/Documents/Sites/simple-ups
ell-app3/node_modules/@react-router/dev/dist/vite.js to a dynamic import() which
is available in all CommonJS modules.
at Object. (/Users/samt/Documents/Sites/simple-upsell-app3/node_m
odules/@react-router/dev/dist/vite.js:62:28) {
code: β€˜ERR_REQUIRE_ESM’
}
── external error ──────────────────────────────────────────────────────────────

Error coming from npm exec react-router dev

Command failed with exit code 1: npm exec react-router dev
failed to load config from
/Users/samt/Documents/Sites/simple-upsell-app3/vite.config.ts
Error [ERR_REQUIRE_ESM]: require() of ES Module
/Users/samt/Documents/Sites/simple-upsell-app3/node_modules/p-map/index.js from
/Users/samt/Documents/Sites/simple-upsell-app3/node_modules/@react-router/dev/di
st/vite.js not supported.
Instead change the require of index.js in /Users/samt/Documents/Sites/simple-ups
ell-app3/node_modules/@react-router/dev/dist/vite.js to a dynamic import() which
is available in all CommonJS modules.
at Object. (/Users/samt/Documents/Sites/simple-upsell-app3/node_m
odules/@react-router/dev/dist/vite.js:62:28) {
code: β€˜ERR_REQUIRE_ESM’
}

────────────────────────────────────────────────────────────────────────────────

2025-10-30T13:22:19.990Z: Running system process:
Β· Command: npm prefix
Β· Working directory: /Users/samt/Documents/Sites/simple-upsell-app3

2025-10-30T13:22:19.997Z: Killing process 2333: /usr/local/lib/node_modules/@shopify/cli/bin/cloudflared tunnel --url http://localhost:50516 --no-autoupdate
2025-10-30T13:22:19.998Z: Killing process 2400: pgrep -lfP 2346

Operating system

Mac OS Sequoia 15.4.1

CLI version

3.86.1

Shell

zsh

Nodejs version

v20.11.1

What language and version are you using in your application?

None yet

I’m running into the same issue. Unfortunately, nothing more to contribute though aside from my specs… Hopefully we get some resolution soon!

Operating System

Mac OS Sequoia 15.6 Beta (24G5074c)

CLI version

3.86.1

Shell

zsh

Nodejs version

v20.11.1

Hey y’all,

Thanks for reporting. We have a fix on the way, meanwhile a workaround is to use node >= 20.12.

-Nick

2 Likes

We are still running into that problem with apps created from the latest remix template. Older apps work just fine. Changing Node version doesn’t help.

We are also running on the same problem, using node > 20.12 does not resolve the problem also

Hi @Marvin_S and @Patryk_D

Could you confirm if you are using the Remix or the React Router template?

React Router template. I’ve managed to make it work but only on node >= 22.12