Getting issue with app frontend of [plugin:vite:import-analysis] Missing "./auto/polaris" specifier

Don't quite understand why I am getting this error... "@gadgetinc/react": "^0.19.0",
20 Replies
AlexFPV
AlexFPVOP6mo ago
[plugin:vite:import-analysis] Missing "./auto/polaris" specifier in "@gadgetinc/react" package I am guessing this is an issue with the packages not working with eachother: "@gadgetinc/react": "^0.18.7", "@gadgetinc/react-shopify-app-bridge": "^0.17.0", "@gadgetinc/shopify-extensions": "^0.3.5", "@shopify/app-bridge": "^3.7.7", "@shopify/app-bridge-react": "^3.7.7", "@shopify/polaris": "^13.9.0", Not a clue on this one - have tried multiple things but just can't get it to work. This is my package.json: { "name": "wishlists", "version": "0.1.0", "description": "Internal package for Gadget app wishlist-template (Development environment)", "license": "UNLICENSED", "private": true, "scripts": { "shopify": "shopify", "build": "NODE_ENV=production vite build", "dev": "NODE_ENV=development shopify app dev --no-update", "info": "shopify app info", "scaffold": "shopify app scaffold", "deploy": "shopify app deploy" }, "workspaces": [ "extensions/*" ], "dependencies": { "@ai-sdk/openai": "^1.1.6", "@fastify/cors": "^9.0.1", "@gadget-client/wishlists": "link:.gadget/client", "@gadgetinc/react": "^0.18.7", "@gadgetinc/react-shopify-app-bridge": "^0.16.7", "@gadgetinc/shopify-extensions": "^0.3.5", "@heroicons/react": "^2.2.0", "@mdxeditor/editor": "^3.21.2", "@react-email/components": "0.0.22", "@react-email/render": "0.0.17", "@shopify/app-bridge-react": "4.0.0", "@shopify/polaris": "^13.9.0", "@shopify/polaris-icons": "^9.3.0", "ai": "^4.1.13", "assert": "^2.0.0", "currency-converter-lt2": "^2.0.0-beta.0", "fastify": "^4.24.2", "gadget-server": "link:.gadget/server", "luxon": "^3.5.0", "openai": "^4.81.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-email": "2.1.6", "react-router-dom": "6.15.0", "shopify-api-node": "^3.12.6", "uuidv4": "^6.2.13", "uvu": "^0.5.6", "zod": "^3.24.1" }, "devDependencies": { "@types/node": "^20.12.8", "@types/react": "^18.0.28", "@types/react-dom": "^18.0.11", "@vitejs/plugin-react-swc": "3.2.0", "typescript": "^5.4.5", "vite": "^5.3.5" } } Here's the log: This is the error in the logs: uncaught promise rejection, exiting process Build failed with 27 errors: web/node_modules/@gadgetinc/react-shopify-app-bridge/dist/src/Provider.js:30:35: ERROR: Could not resolve "@shopify/app-bridge-utils" web/node_modules/@gadgetinc/react-shopify-app-bridge/dist/src/Provider.js:31:26: ERROR: Could not resolve "@shopify/app-bridge/actions" web/node_modules/@shopify/app-bridge-react/components/ClientRouter/router.js:4:24: ERROR: Could not resolve "@shopify/app-bridge/actions" web/node_modules/@shopify/app-bridge-react/components/Loading/Loading.js:22:24: ERROR: Could not resolve "@shopify/app-bridge/actions" web/node_modules/@shopify/app-bridge-react/components/Modal/Modal.js:26:22: ERROR: Could not resolve "@shopify/app-bridge/actions/Modal" ...
Chocci_Milk
Chocci_Milk6mo ago
Hello, The issue seems to actually be that you're using @shopify/app-bridge although its deprecated. I would recommend looking at Shopify's migration to @shopify/app-bridge-react docs Make sure to also upgrade the other Gadget packages And move polaris to the latest version
AlexFPV
AlexFPVOP6mo ago
So I've updated all the gadget packages to the latest and polaris... Noticed I had a yarn.lock inside the web folder which was referencing old versions of the packages so I deleted the yarn lock in the web folder. However we're still getting errors like this: Error: Build failed with 27 errors: web/node_modules/@gadgetinc/react-shopify-app-bridge/dist/src/Provider.js:30:35: ERROR: Could not resolve "@shopify/app-bridge-utils" web/node_modules/@gadgetinc/react-shopify-app-bridge/dist/src/Provider.js:31:26: ERROR: Could not resolve "@shopify/app-bridge/actions" web/node_modules/@shopify/app-bridge-react/components/ClientRouter/router.js:4:24: ERROR: Could not resolve "@shopify/app-bridge/actions" web/node_modules/@shopify/app-bridge-react/components/Loading/Loading.js:22:24: ERROR: Could not resolve "@shopify/app-bridge/actions" web/node_modules/@shopify/app-bridge-react/components/Modal/Modal.js:26:22: ERROR: Could not resolve "@shopify/app-bridge/actions/Modal" ... at failureErrorWithLog (/gadget/app/node_modules/vite/node_modules/esbuild/lib/main.js:1472:15) at /gadget/app/node_modules/vite/node_modules/esbuild/lib/main.js:945:25 at /gadget/app/node_modules/vite/node_modules/esbuild/lib/main.js:1353:9 at processTicksAndRejections (node:internal/process/task_queues:95:5)
Chocci_Milk
Chocci_Milk6mo ago
Did you remove the @shopify/app-bridge package completely? It seems to really be complaining about it
AlexFPV
AlexFPVOP6mo ago
Yes I have removed it from my package.json : "dependencies": { "@ai-sdk/openai": "^1.1.6", "@fastify/cors": "^9.0.1", "@gadget-client/wishlists": "link:.gadget/client", "@gadgetinc/react": "^0.19.1", "@gadgetinc/react-shopify-app-bridge": "^0.17.0", "@gadgetinc/shopify-extensions": "^0.3.5", "@heroicons/react": "^2.2.0", "@mdxeditor/editor": "^3.21.2", "@react-email/components": "0.0.22", "@react-email/render": "0.0.17", "@remix-run/router": "^1.15.0", "@shopify/app-bridge-react": "^4.1.5", "@shopify/polaris": "^13.8.0", "@shopify/polaris-icons": "^9.3.0", "ai": "^4.1.13", "assert": "^2.0.0", "currency-converter-lt2": "^2.0.0-beta.0", "fastify": "^4.24.2", "gadget-server": "link:.gadget/server", "luxon": "^3.5.0", "openai": "^4.81.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-email": "2.1.6", "react-router": "7.0.2", "shopify-api-node": "^3.12.6", "uuidv4": "^6.2.13", "uvu": "^0.5.6", "zod": "^3.24.1" }, "devDependencies": { "@types/node": "^20.12.8", "@types/react": "^18.0.28", "@types/react-dom": "^18.0.11", "@vitejs/plugin-react-swc": "3.2.0", "typescript": "^5.4.5", "vite": "^5.3.5" } }
Chocci_Milk
Chocci_Milk6mo ago
Could you please try the reset node_modules command in the command palette? The error is saying something about a really outdated version of @gadgetinc/react-shopify-app-bridge. Doesn't make any sense to me
AlexFPV
AlexFPVOP6mo ago
Just ran that reset node_models however still getting the same type of error : Error: Build failed with 27 errors: web/node_modules/@gadgetinc/react-shopify-app-bridge/dist/src/Provider.js:30:35: ERROR: Could not resolve "@shopify/app-bridge-utils" web/node_modules/@gadgetinc/react-shopify-app-bridge/dist/src/Provider.js:31:26: ERROR: Could not resolve "@shopify/app-bridge/actions" web/node_modules/@shopify/app-bridge-react/components/ClientRouter/router.js:4:24: ERROR: Could not resolve "@shopify/app-bridge/actions" web/node_modules/@shopify/app-bridge-react/components/Loading/Loading.js:22:24: ERROR: Could not resolve "@shopify/app-bridge/actions" web/node_modules/@shopify/app-bridge-react/components/Modal/Modal.js:26:22: ERROR: Could not resolve "@shopify/app-bridge/actions/Modal" ... at failureErrorWithLog (/gadget/app/node_modules/vite/node_modules/esbuild/lib/main.js:1472:15) at /gadget/app/node_modules/vite/node_modules/esbuild/lib/main.js:945:25 at /gadget/app/node_modules/vite/node_modules/esbuild/lib/main.js:1353:9 at processTicksAndRejections (node:internal/process/task_queues:95:5) Seems to be making the same error for webhooks and background actions too
Chocci_Milk
Chocci_Milk6mo ago
Could you please remind me of the URL of your application?
AlexFPV
AlexFPVOP6mo ago
Sure > wishlists.gadget.app
Chocci_Milk
Chocci_Milk6mo ago
Not sure how this happened but your application is in a weird state internally Gonna try to fix it I think that this extension folder is causing issues
Chocci_Milk
Chocci_Milk6mo ago
No description
Chocci_Milk
Chocci_Milk6mo ago
Would you allow me to make modifications? Might I ask why you have a vite.config in it?
AlexFPV
AlexFPVOP6mo ago
I see, yes so the vite.config is for bundling the react app into the theme extension
Chocci_Milk
Chocci_Milk6mo ago
You might want to remove the .gadget folder from that folder
Chocci_Milk
Chocci_Milk6mo ago
This might also be the line that's actually being complained about (App.tsx)
No description
Chocci_Milk
Chocci_Milk6mo ago
Btw, you don't need to have this package in your extension folder:
No description
Chocci_Milk
Chocci_Milk6mo ago
You should be able to use the root node_modules version Right now, in terms of package versions, I only see the nested react package as a conflict Want me to remove it for you?
AlexFPV
AlexFPVOP6mo ago
Yes please if you don't mind! Apologies for the mess! I am a 'vibe' coder so am learning as I go - I am a shopify theme dev mostly so am new to react etc...
Chocci_Milk
Chocci_Milk6mo ago
Ok, can you test again please?
AlexFPV
AlexFPVOP6mo ago
YES, that's stopped the errors! Just getting an error on the frontend but think its an easy one to fix! Thank you for your assistance on this - I really appreciate it!

Did you find this page helpful?