Ok, I think I figured out what my issue was, though changing the api version should help.
We haven’t been using the CLI to actually generate the app; we have a custom template we use, but we haven’t used extensions before.
We had conflicting versions of the @Shopify_77 /cli (v3.49.3) and @Shopify_77 /app (v3.47.5).
So even though the cli was up to date, when I generated an extension, it was wrong.
Though, it still seems like there are issues:
Here’s my base package.json before adding any extensions
{
"name": "shopify-astro-app",
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
"astro": "astro",
"shopify:dev": "shopify app dev"
},
"dependencies": {
"@astrojs/netlify": "^2.3.0",
"@shopify/app": "3.49.3",
"@shopify/cli": "3.49.3",
"@shopify/shopify-api": "^7.5.0",
"@xata.io/client": "^0.24.3",
"astro": "^2.8.1",
"netlify-cli": "^15.9.1"
},
"devDependencies": {
"npm-check-updates": "^16.14.4"
}
}
Note the latest versions of the cli and app pinned to that version for now.
That all installs fine. But I get the following error when generating an extension:
Error coming from `npm install react@^17.0.0 --save-prod`
Command failed with exit code 1: npm install react@^17.0.0 --save-prod
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: shopify-astro-app@0.0.1
npm WARN Found: react@18.2.0
npm WARN node_modules/react
npm WARN peer react@"18.2.0" from /app@3.49.3
npm WARN node_modules/@shopify/app
npm WARN /app@"3.49.3" from the root project
npm WARN 4 more (@shopify/cli-kit, ink, react-reconciler, the root project)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"18.2.0" from /app@3.49.3
npm WARN node_modules/@shopify/app
npm WARN /app@"3.49.3" from the root project
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: shopify-astro-app@0.0.1
npm WARN Found: react@18.2.0
npm WARN node_modules/react
npm WARN peer react@"18.2.0" from /app@3.49.3
npm WARN node_modules/@shopify/app
npm WARN /app@"3.49.3" from the root project
npm WARN 4 more (@shopify/cli-kit, ink, react-reconciler, the root project)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@">=18.0.0" from ink@4.2.0
npm WARN node_modules/ink
npm WARN peer ink@"4.2.0" from /app@3.49.3
npm WARN node_modules/@shopify/app
npm WARN 1 more (@shopify/cli-kit)
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: /app@3.49.3
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR! react@"^17.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer ink@"4.2.0" from /app@3.49.3
npm ERR! node_modules/@shopify/app
npm ERR! /app@"3.49.3" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react@18.2.0
npm ERR! node_modules/react
npm ERR! peer react@">=18.0.0" from ink@4.2.0
npm ERR! node_modules/ink
npm ERR! peer ink@"4.2.0" from /app@3.49.3
npm ERR! node_modules/@shopify/app
npm ERR! /app@"3.49.3" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! /Users/charlesloder/.npm/_logs/2023-09-28T14_38_38_151Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in: /Users/charlesloder/.npm/_logs/2023-09-28T14_38_38_151Z-debug-0.log
Running npm ls react
gives:
shopify-astro-app@0.0.1
└─┬ /app@3.49.3
├─┬ /cli-kit@3.49.3
│ └── react@18.2.0 deduped
├─┬ ink@4.2.0
│ ├─┬ react-reconciler@0.29.0
│ │ └── react@18.2.0 deduped
│ └── react@18.2.0 deduped
└── react@18.2.0
No react 17 like in the error:
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR! react@"^17.0.0" from the root project
I’m unsure now if this is the shopify app or something in my code. Let me know if I should enter a github issue