Unable to deploy extensions suddenly!

Hi , im using the latest remix template for the app and i have also used theme extensions, checkout extensions
with my app.

I used to deploy my extensions from my laptop itself using

npm run build
npm run deploy

Everything was working properly but today i made a few changes in my extensions and removed my node_modules and did a npm i

now i wanted to redeploy the extensions. So i did
npm run build โ†’ it was success

i did
npm run deploy

This failed and gave me the error

Could not resolve โ€œ@remote-ui/reactโ€
โ”€ error โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ โ”‚
โ”‚ Build failed with 43 errors: โ”‚
โ”‚ extensions/checkout-ui/node_modules/@shopify/ui-extensions-react/build/esm/surfaces/checkout/components/Banner/Banner.mjs:2:43: ERROR: Could not resolve โ€œ@remote-ui/reactโ€ โ”‚
โ”‚ extensions/checkout-ui/node_modules/@shopify/ui-extensions-react/build/esm/surfaces/checkout/components/BlockLayout/BlockLayout.mjs:2:43: ERROR: Could not resolve โ”‚
โ”‚ โ€œ@remote-ui/reactโ€ โ”‚
โ”‚ extensions/checkout-ui/node_modules/@shopify/ui-extensions-react/build/esm/surfaces/checkout/components/BlockSpacer/BlockSpacer.mjs:2:43: ERROR: Could not resolve โ”‚
โ”‚ โ€œ@remote-ui/reactโ€ โ”‚
โ”‚ extensions/checkout-ui/node_modules/@shopify/ui-extensions-react/build/esm/surfaces/checkout/components/BlockStack/BlockStack.mjs:2:43: ERROR: Could not resolve โ”‚
โ”‚ โ€œ@remote-ui/reactโ€ โ”‚
โ”‚ extensions/checkout-ui/node_modules/@shopify/ui-extensions-react/build/esm/surfaces/checkout/components/Button/Button.mjs:2:43: ERROR: Could not resolve โ€œ@remote-ui/reactโ€ โ”‚
โ”‚ โ€ฆ โ”‚
โ”‚ โ”‚
โ”‚ To investigate the issue, examine this stack trace: โ”‚
โ”‚ at mjs:2:43: ERROR: Could not resolve " โ”‚
โ”‚ at mjs:2:43: ERROR: Could not resolve " โ”‚
โ”‚ at mjs:2:43: ERROR: Could not resolve " โ”‚
โ”‚ at mjs:2:43: ERROR: Could not resolve " โ”‚
โ”‚ at mjs:2:43: ERROR: Could not resolve " โ”‚
โ”‚ at failureErrorWithLog (@shopify/app/node_modules/esbuild/lib/main.js:1639) โ”‚
โ”‚ let error = new Error(${text}${summary}); โ”‚
โ”‚ at (@shopify/app/node_modules/esbuild/lib/main.js:1051) โ”‚
โ”‚ const error = failureErrorWithLog(โ€œBuild failedโ€, originalErrors.concat(onEndErrors), originalWarnings.concat(onEndWarnings)); โ”‚
โ”‚ at runOnEndCallbacks (@shopify/app/node_modules/esbuild/lib/main.js:1474) โ”‚
โ”‚ let runOnEndCallbacks = (result, done) => done(, ); โ”‚
โ”‚ at buildResponseToResult (@shopify/app/node_modules/esbuild/lib/main.js:1049) โ”‚
โ”‚ runOnEndCallbacks(result, (onEndErrors, onEndWarnings) => { โ”‚
โ”‚ at (@shopify/app/node_modules/esbuild/lib/main.js:1061) โ”‚
โ”‚ buildResponseToResult(request2, (err, result, onEndErrors, onEndWarnings) => { โ”‚
โ”‚ at new Promise โ”‚
โ”‚ at on-end (@shopify/app/node_modules/esbuild/lib/main.js:1060) โ”‚
โ”‚ requestCallbacks[โ€œon-endโ€] = (id, request2) => new Promise((resolve) => { โ”‚
โ”‚ at handleRequest (@shopify/app/node_modules/esbuild/lib/main.js:726) โ”‚
โ”‚ await callback(id, request); โ”‚
โ”‚ at handleIncomingPacket (@shopify/app/node_modules/esbuild/lib/main.js:748) โ”‚
โ”‚ handleRequest(packet.id, packet.value); โ”‚
โ”‚ at readFromStdout (@shopify/app/node_modules/esbuild/lib/main.js:676) โ”‚
โ”‚ handleIncomingPacket(stdout.subarray(offset, offset + length)); โ”‚
โ”‚

why does it happen? and how to solve this issue? we are going to go live soon and suddenly im facing this issue, kindly someone give some insights pls..

Hi Ndt_ts,

The โ€œ@remote-ui/reactโ€ could not be resolved error message indicates that the module is not installed or not found. Here are some things you could try to fix this issue:

  1. Check your package.json file: Make sure that the โ€œ@remote-ui/reactโ€ module is listed in the dependencies of your package.json file.

  2. Reinstall the module: Runnpm install @remote -ui/reactto install the module.

  3. Reinstall all modules: Delete the node_modules folder and the package-lock.json file, then run npm install to reinstall all modules.

  4. Check the moduleโ€™s import path: Make sure that the import path in your code matches exactly with the installed module path. Case sensitivity or small typos can cause the module to not be found.

  5. Clear the npm cache: Run npm cache clean --force and then reinstall the modules.

  6. Check your environment: Make sure you are in the correct directory when running npm commands.

If none of these solutions work, the issue might be specific to the โ€œ@remote-ui/reactโ€ module or the way your project is set up. In that case, you might want to open an issue in the moduleโ€™s repo here.

Hope this helps

Thanks for your reply @Liam

I have some fundamental questions and it would be very helpful, if you shed some light on them.

I have deployed my staging application in my server.

  1. My idea is to deploy the extensions of this hosted app from my local system itself. is it fine doing it? or should i deploy only form my server whose url i have set in my shopify app setup.

  2. It was getting deployed correctly and suddenly it started to fail as given in the question. My wild guess is that, the shopify.app.toml should be having my old cloudflare url and it failed owing to it? am i right?

3.i basically replaced shopify.app.toml with my correct app url manually. but is there a way to connect my code to the app created in the store so that shopify.app.toml will automatically fetch the correct app details, url etc . I know if i do npm run dev, it will fetch. But will doing that change my urls setup in App Setup to the cloudflare temporary url? and what is the best way to connect my code to my app for deploying the extensions of my application?

  1. even after replacing correct urls in shopify.app.toml , i wasnโ€™t able to deploy the app and still was facing the error in question for which, after seeing your reply i installed @remote-ui/react in my checkout extension and i was able to deploy the app extensions from my local.
    but this dependency is not being explicitly used by me in any part of my code, but still it gives me this error? any idea why? and i didnโ€™t face this issue any time beforeโ€ฆ

On what hosting did you deploy your app? Did you use a vps, if yes can you share a feedback how you did it, please.