Shopify / shopify-app-js

MIT License
259 stars 101 forks source link

i18n import with type in AppProvider causes deployment to fail #1256

Closed s-prestele-tqgg closed 4 weeks ago

s-prestele-tqgg commented 1 month ago

Issue summary

Before opening this issue, I have:

We have upgraded to Node22 and the latest version of shopify-app-remix, this works fine locally when using the CLI, however, fails to deploy to production in CI.

The error can be seen here: Bildschirmfoto 2024-07-24 um 14 37 41

File in question

it was also described here

Arkham commented 1 month ago

Hey @s-prestele-tqgg,

thanks for reporting this. I can see that the error comes from pnpm install. Could you try specifying use-node-version=YOUR_NODE_VERSION inside your .npmrc?

s-prestele-tqgg commented 1 month ago

Hey @s-prestele-tqgg,

thanks for reporting this. I can see that the error comes from pnpm install. Could you try specifying use-node-version=YOUR_NODE_VERSION inside your .npmrc?

@Arkham thanks for checking this for me. Unfortunately, this did not solve the issue. It failed with the same error.

Arkham commented 1 month ago

can you verify that on the production environment you're using the same version of node and pnpm that you're using locally? I also saw this bug that related to pnpm and workspaces, something you might want to investigate.

s-prestele-tqgg commented 1 month ago

can you verify that on the production environment you're using the same version of node and pnpm that you're using locally? I also saw this bug that related to pnpm and workspaces, something you might want to investigate.

Yes, both locally and during production build the same node and pnpm versions are being used. i also tried with pnpm 8 and 9 and the result is the same.

iamdavehart commented 1 month ago

I was having this issue too when I upgraded all my dependencies today. My app was pre Feb '24 so I had to go through the migration steps to using vite as that was the new compiler. however I was still getting the problem, but it was only when I noticed that the remix commands that are executed remix dev were specified in shopify.*.toml and it wasn't executing the vite version of the compiler. Your production version is coming from docker-start, so perhaps you need to update that script (it calls npm setup and npm start - I also needed a new npm start)

NguyenQuangHuy282002 commented 1 month ago

I've upgraded to the latest version of shopify-app-remix and facing this issue too. I use remix build to build app. May be we should try using Vite to build instead.

nullndr commented 4 weeks ago

Using remix vite:build to build the project fixes this error.

s-prestele-tqgg commented 4 weeks ago

@nullndr thanks! currently still in the process of migrating to Vite. But hopefully this will resolve once it's completed

s-prestele-tqgg commented 4 weeks ago

This was indeed resolved when migrating from classic remix compiler to vite. Therefore closing the issue