Skip to content
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

Error deploying on Vercel with Node v18 #69

Closed
oddmouse opened this issue May 25, 2023 · 2 comments
Closed

Error deploying on Vercel with Node v18 #69

oddmouse opened this issue May 25, 2023 · 2 comments

Comments

@oddmouse
Copy link

Vercel is depreciating Node 16 soon but I'm having an issue getting it to work on version 18. Deploying in a serverless function on Node 16 works fine, but on Node 18 it returns an error saying the s2.node module is missing. I created a vercel-build script to locate the file in the build step and it seems to exist in the same place that it does in the working deployment. I'm not really sure how else to troubleshoot this.

Node 16 (working):
https://radarlabs-71k264462-unilease1.vercel.app/api/radius

Node 18 (not working):
https://radarlabs-9xyzsq3jp-unilease1.vercel.app/api/radius

Function Log error message:

Cannot find module '/var/task/node_modules/@radarlabs/s2/lib/binding/Release/node-v108-linux-x64/s2.node'
Require stack:
- /var/task/node_modules/@radarlabs/s2/index.js
Did you forget to add it to "dependencies" in `package.json`?

Here is a repo I made to recreate the issue:
https://github.com/unilease/vercel-radarlabs-s2-mre

@jkao
Copy link
Collaborator

jkao commented Jun 13, 2023

Interesting. We're currently running Node 18 on Linux with this library. I wonder if it's related to this: #68

@oddmouse
Copy link
Author

Got it working! Yes, it was partially related to #68. I had to include the binary created from that issue and copy it over with a vercel-build script to avoid the GLIBC_2.29 not found issue.

I also had to force include the library in the vercel.json config:

{
  "functions": {
    "api/radius.mjs": {
      "includeFiles": "node_modules/@radarlabs/s2/**"
    }
  }
}

Node 18 working link:
https://vercel-radarlabs-s2-2q5g00632-unilease1.vercel.app/api/radius

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants