Open sergeyClover opened 8 months ago
Hi, and thanks for your request!
Your issue is most likely related to this issue of the next.js framework, which is the base of this project: https://github.com/vercel/next.js/discussions/32236
I have followed this issue a long time already and it seems that there's still no viable solution for this, but if you have an idea, please let me know! I "fixed" the issue by moving away from vercel and hosting the project on heroku. Unfortunately, they abounded their free tier.
Just found out a solution:
assets/${file}
);hope it helps someone in the future ;)
I'm glad to hear that you found a solution! Do you know if the code works in all three environments: development, production, and standalone production?
Works in vercel production environment. Didnt test on dev or standalone just yet as it seems that puppeteer is not working as well on vercel.
Hello. I have been testing out the application and it seems like asset files such as HTML templates for emails and invoices are not present in .next folder after build.
I tried a few things in next.config.js as well as some testing with changing "copy-standalone" script but nothing seems to work.
Error:Unhandled Promise Rejection {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"Error: ENOENT: no such file or directory, open '/var/task/.next/server/chunks/assets/invoice/template.html'","reason":{"errorType":"Error","errorMessage":"ENOENT: no such file or directory, open '/var/task/.next/server/chunks/assets/invoice/template.html'","code":"ENOENT","errno":-2,"syscall":"open","path":"/var/task/.next/server/chunks/assets/invoice/template.html","stack":["Error: ENOENT: no such file or directory, open '/var/task/.next/server/chunks/assets/invoice/template.html'"," at Object.openSync (node:fs:596:3)"," at Object.readFileSync (node:fs:464:35)"," at getStaticAssetFile (/var/task/.next/server/chunks/4161.js:96:52)"," at /var/task/.next/server/chunks/7256.js:506:359"]},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: Error: ENOENT: no such file or directory, open '/var/task/.next/server/chunks/assets/invoice/template.html'"," at process. (file:///var/runtime/index.mjs:1276:17)"," at process.emit (node:events:529:35)"," at emit (node:internal/process/promises:149:20)"," at processPromiseRejections (node:internal/process/promises:283:27)"," at process.processTicksAndRejections (node:internal/process/task_queues:96:32)"]}
Unknown application error occurred
Runtime.Unknown
Help would be appreciated. :)