-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vercel serverless function bug? #121
Comments
Additional info The build step is:
The runtime config is:
Seems to be happening at this line inside
|
Looks like |
It seems to be a relatively simple issue: the failing assertion inside |
Here is the ncc packed output for the current function, if this helps.
Also looks like they replace https://github.com/vercel/ncc/blob/b2a325dec1dc54f2168f838dee0b9e48ee701d18/src/index.js#L552 Maybe this could be a config setting or ENV var to guide/override the loading process in challenging installs? |
Good to know, thank you! Fix released as |
Well, now Vercel is throwing this. Hmmm.
|
Hm. What does |
A bit confused actually. What code path are we trying to go down? The web app is Vike, but the serverless function is built with ncc (webpack). The serverless load is failing on invocation. Would it help to specify the Telefunc file to load? I only have one with all server side behaviors for a cart system. Since we reached the
Is the intent to have this block run?
|
You're right.
That seems to be the culprit. Why is it (Btw. reproduction welcome if you prefer.) |
I have two serverless function builds. One for a Vike SSR, and another just for Telefunc. I wanted separate functions. Since Vike is not imported in the Telefunc one, is the global not getting set?
|
That makes sense. I've an idea to make it work. Let me finish what I'm currently working on then I'll implement it. |
Solved it. If you are using a Vike file structure, but not importing it in a serverless function implementation, then just do:
Also, the Webpack fix you made allows this to work with Thank you!!! |
Indeed, that workaround should work. I'll be implementing a proper fix next week. |
Followed the examples and deployed a Vercel serverless handler. Upon calling a function, a "bug" is logged. Everything builds correctly and it runs locally with a dev server. Using Build Output API v3.
Vercel serverless log:
The handler:
Config.json
NOTE: I have a Vike serverless renderer as another function and it works perfectly.
Any ideas on what to try?
The text was updated successfully, but these errors were encountered: