muxinc / next-video

The easiest way to add video in your Nextjs app.
https://next-video.dev
MIT License
821 stars 31 forks source link

Vercel does not support functions inside next.config.js #304

Open fain182 opened 3 weeks ago

fain182 commented 3 weeks ago

A few days ago I tried to deploy next-video with a custom configuration to save assets data in the backend, but there was a strange error, as if the saveAsset and LoadAsset functions were not defined.

I contacted Vercel support, who escalated the issue to the engineering team and informed me that:

Our internal team have identified that next-video is using the deprecated serverRuntimeConfig feature to define a function that is supposed to be accessible at runtime. Defining functions is not supported either for standalone output or Vercel deployments, as the config is serialized at built time, thus making the function property undefined at runtime.

I am a little confused about the best way to solve this...

luwes commented 3 weeks ago

Thanks for reporting. Strange I didn't run into this with the other functions, in dev mode it might be fine. I see Next.js itself sometimes uses string file paths in some config props, maybe that could be a solution for us too.

I will help solve this one in the upcoming weeks.