Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
Upon installing with npm create @Shopify/hydrogen or npm create @Shopify/hydrogen@latest
System keeps throw the Errors as below:
ERROR Cannot read properties of null (reading 'useState')
~/.npm/_npx/c78eec8d27f8df64/node_modules/@shopify/cli-kit/node_modules/react/cjs/react.development.js:1622:21
1619: }
1620: function useState(initialState) {
1621: var dispatcher = resolveDispatcher();
1622: return dispatcher.useState(initialState);
1623: }
1624: function useReducer(reducer, initialArg, init) {
1625: var dispatcher = resolveDispatcher();
- useState (~/.npm/_npx/c78eec8d27f8df64/node_modules/@shopify/cli-kit/node_modules/react/cjs/react.development.js:1622:21)
- usePrompt (file:///~/.npm/_npx/c78eec8d27f8df64/node_modules/@shopify/cli-kit/dist/private/node/ui/hooks/use-prompt.js:11:43)
- SelectPrompt (file:///~/.npm/_npx/c78eec8d27f8df64/node_modules/@shopify/cli-kit/dist/private/node/ui/components/SelectPrompt.js:12:64)
- renderWithHooks (~/.npm/_npx/c78eec8d27f8df64/node_modules/react-reconciler/cjs/react-reconciler.development.js:6659:18)
- mountIndeterminateComponent (~/.npm/_npx/c78eec8d27f8df64/node_modules/react-reconciler/cjs/react-reconciler.development.js:11276:13)
- beginWork (~/.npm/_npx/c78eec8d27f8df64/node_modules/react-reconciler/cjs/react-reconciler.development.js:12799:16)
- beginWork$1 (~/.npm/_npx/c78eec8d27f8df64/node_modules/react-reconciler/cjs/react-reconciler.development.js:19608:14)
- performUnitOfWork (~/.npm/_npx/c78eec8d27f8df64/node_modules/react-reconciler/cjs/react-reconciler.development.js:18742:12)
- workLoopSync (~/.npm/_npx/c78eec8d27f8df64/node_modules/react-reconciler/cjs/react-reconciler.development.js:18648:5)
- renderRootSync (~/.npm/_npx/c78eec8d27f8df64/node_modules/react-reconciler/cjs/react-reconciler.development.js:18616:7)
I'm having the same issue.
I am also facing the same issue
Same problem here
same here, any solution yet?
Same problem here XD
same problem
the same issue
I'm having the same issue, shopify can fix this pls?
Im also getting this error. So has anyone found out why?
samesies
Facing similar issue. Any fix available?
Facing the same error with a fresh install of the remix app template.
I was able to resolve this for myself yesterday, after much trial and error. What worked for me was manually updating my package.json file to use the latest versions of the following packages. These are the latest versions as of this writing:
"@shopify/app": "3.58.2",
"@shopify/app-bridge-react": "^4.1.3",
"@shopify/cli": "3.59.2",
"@shopify/shopify-api": "^10.0.0",
"@shopify/shopify-app-remix": "^2.8.2",
"@shopify/shopify-app-session-storage-prisma": "^4.0.5"
After setting those versions in package.json, delete your node_modules folder(s) and your package-lock file, then run npm install again. After this npm run dev command started working for me again.
Yeah, this worked for me. How did you figure out that updating the packages was the issue?
Id usually thinks the latest ones are more unstable.
A lot of trial and error and researching the specific error codes and related dependencies. It wasn't a fun journey.
Thanks a lot @ddiehlpdx you saved my day. I had the same issue, but it was related to running an existing app with the POS UI extension inside. Irritating react hook related issues nearly drove me crazy.
I tried upgrading CLI but didn't account for the other @shopify/... packages. THANKS!