0

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.

8
  • Latest LTS of node is v20, in a week it will be v22, I recommend to upgrade overall. Also your logs look just fine (all green). Also you use the app as SSR, I'm not sure that Netlify gives you a full-time running Node server. Hence why it works locally but not remotely. Do you mind doing some SSG rather (nuxt generate)? I also recommend trying to setup the workflow first, because it's usually easier to debug for when you need to actually deploy the app. Commented Oct 15, 2024 at 10:13
  • Thank you for your comment, I will give this a shot. Commented Oct 15, 2024 at 12:38
  • Any success with the environment? Commented Oct 16, 2024 at 7:23
  • Sadly it is still not working. So i am reconding the entire backend for this... Commented Oct 17, 2024 at 17:14
  • Why? Swap it to SSG and it will work. You don't need to recode the entire backend. Also, what is not working when shipping as a static app? Commented Oct 17, 2024 at 19:23

1 Answer 1

0

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.