Closed vanling closed 6 months ago
Will close this :). I think this is too specific for my usecase. Not so many people deploy nuxt on Ubuntu(x86) via Jenkins on a MAC os(arm).
For others who might end up here. For the same issue. You can not deploy the .output folder on a secondary system when this module is installed.
This issue was a debug in progress, i'm jotting down notes here while testing/debugging, might even close this later tonight when I discover I'm just doing something wrong here 👀 updates are below
So I build multiple Nuxt websites via Jenkins on a M1 Mac Mini.. and from there only deploy the
.output
folder from Nuxt, this is why i love nuxt, keeps is small and deploys fast.But, and i don't know if i'm at the correct place at thuis moment to share this... it turns out building on an ARM machine and hosting the .output on a x86 machine breaks the useCompiler in Nuxt with the following error from ESBuild.
this issue goes away when i run nuxt locally or build and run on server.
Unable to find the email template file
update1: Tried with yarn, no bueno. Almost sure this isn't because of vue-mail, but could be a vite thing when dynamicly trying to load the template.
update2: -Trying to force esbuild to esbuild-wasm dirty aliassing trick-. that was dumb.
update3: wasm thingy failed, i'm a bit more sure about vue-mail. When removing vue-mail, there is no esbuild included in
/.output/server/package.json
and when i add vue-mail again its back"esbuild": "0.15.18",
ok it is 100% pinpointed to the following dependancy.
Conclusion
Building Nuxt projects on an ARM-based machine (Machine A) and deploying the .output folder to an Intel/x86-based machine (Machine B) leads to compatibility issues with the email compiler in Nuxt. This problem arises because the compiler uses import-string, which seems to depend on esbuild?, a tool not compatible across different architectures. The presence of esbuild within the .output/server/modules appears to be the core issue. Attempts to resolve this through methods such as using yarn were unsuccessful, underscoring the problem's specificity to the @vue-email/compiler dependency and its use of esbuild. Furthermore, this situation suggests that Nuxt is not designed to handle architecture-dependent dependencies within its build output, as their presence can lead to such cross-architecture deployment issues.