node.jsnuxt3.js

Lib working in netlify dev, in netlify preview PR but not in production (Nuxt)


I have a lib that is working when it is deployed in preview, it also works on the dev server but it does not work when the server runs in standalone mode. I get the following error in the client console: Object { message: 'invalid line (no token ";" or ":") "<!DOCTYPE html><html data-capo=""><head><meta charset="utf-8">"', name: "ParserError", stack: "f._handleContentLine@https://iut-onboardin.netlify.app/_nuxt/Bu-f8MEs.js:31:1198\nf/<@https://iut-onboardin.netlify.app/_nuxt/Bu-f8MEs.js:31:119\nf._eachLine@https://iut-onboardin.netlify.app/_nuxt/Bu-f8MEs.js:33:107\nf@https://iut-onboardin.netlify.app/_nuxt/Bu-f8MEs.js:31:91\nparseEvents@https://iut-onboardin.netlify.app/_nuxt/Bu-f8MEs.js:34:55022\ngetEvents@https://iut-onboardin.netlify.app/_nuxt/Bu-f8MEs.js:24:43386\n" }

Here is my source code where this problem happens. The NodeJS version running in deploy environment is the same as the one on my machine (v18.20.4) Here are the deploy logs.

I already tried many fixes but nothing is working, from using the official $fetch from Nuxt to the classic fetch of JavaScript.

PS: For mods, if I didn't format my post correctly I am sorry about this. For other peaple, sorry for my English.


Solution

  • I did the backend all over again with a proxy endpoint so now it is working. The library was trying to hit a URL that should have been handled by netlify but it was not. So now the lib is gone and everything works.