Skip to content
This repository has been archived by the owner on Jun 22, 2024. It is now read-only.

Nuxt compiler bug in production #40

Closed
HugoRCD opened this issue Mar 21, 2024 · 6 comments
Closed

Nuxt compiler bug in production #40

HugoRCD opened this issue Mar 21, 2024 · 6 comments

Comments

@HugoRCD
Copy link

HugoRCD commented Mar 21, 2024

I created this issue on the main package, but I think it's more appropriate here

vue-email/vue-email#168

@Gugustinette
Copy link

Running into the exact same problem on Vercel Serverless runtime.

I'm getting these 2 errors at the same time when trying to render a template using useCompiler :

Error: Error rendering template ResetPassword: Error: Component ResetPassword not found
    at templateRender (file:///var/task/node_modules/@vue-email/compiler/dist/index.mjs:57021:11)
    at async useCompiler (file:///var/task/chunks/routes/api/auth/ask-reset-password.post.mjs:34:20)
    at async sendEmail (file:///var/task/chunks/routes/api/auth/ask-reset-password.post.mjs:56:22)
    at async Object.handler (file:///var/task/chunks/routes/api/auth/ask-reset-password.post.mjs:100:3)
    at async Object.handler (file:///var/task/chunks/runtime.mjs:2998:19)
    at async toNodeHandle (file:///var/task/chunks/runtime.mjs:3264:7)
    at async Server.<anonymous> (/opt/node-bridge/bridge-server-CNJTFAIF.js:1:9585)
Error loading component Error: The package "esbuild-linux-64" could not be found, and is needed by esbuild.

If you are installing esbuild with npm, make sure that you don't specify the
"--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature
of "package.json" is used by esbuild to install the correct binary executable
for your current platform.
    at generateBinPath (/var/task/node_modules/esbuild/lib/main.js:1819:15)
    at esbuildCommandAndArgs (/var/task/node_modules/esbuild/lib/main.js:1886:33)
    at ensureServiceIsRunning (/var/task/node_modules/esbuild/lib/main.js:2051:25)
    at startSyncServiceWorker (/var/task/node_modules/esbuild/lib/main.js:2261:19)
    at Object.<anonymous> (/var/task/node_modules/esbuild/lib/main.js:2302:3)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)

I guess this has something to do with

let source = await useStorage(storageKey).getItem(filename)
, but i'm not quite sure what is useStorage here. Is that the one from Nitro and UnStorage ?
From my understanding, this is by default some in-memory key-value storage, which then do not make sense in the context of a serverless function ?
But that still won't explain why "esbuild-linux-64" won't be found ? I tried to force install it locally on my project but it still wasn't found in Vercel's serverless context.

@eliabieri
Copy link

I'm facing the exact same problem

@dcln00
Copy link

dcln00 commented Apr 11, 2024

I'm facing the exact same problem as well

@dcln00
Copy link

dcln00 commented Apr 11, 2024

I had it fixed. Deleted package-lock.json and node modules directory and installed it again fixed it.

@Gugustinette
Copy link

Fixed here in theory vue-email/vue-email#168

@Flowko Flowko mentioned this issue Jun 4, 2024
5 tasks
@Flowko
Copy link
Member

Flowko commented Jun 22, 2024

we just merged a new project rewrite, please do check the docs and the updated logic https://vuemail.net/

@Flowko Flowko closed this as completed Jun 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants