-
Notifications
You must be signed in to change notification settings - Fork 86
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
API routes with 3rd party dependencies fail the build #517
Comments
@MKrupauskas hello! can you try adding |
Hi! Thanks for the help, it solved the issue. Makes me wonder why this is not the default then? |
@MKrupauskas of course! and yeah, good question. the original next-on-netlify author and i once discussed defaulting to |
* added input * add if to stop deplot if not run ID * changes input type to boolean * remove string * revert --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Describe the bug
Using third party libraries in nextjs API routes breaks the build. It might be related to netlify-lambda functions not bundling 3rd party libraries like firebase nicely. See the possibly related issue below.
To Reproduce
Steps to reproduce the behavior:
/pages/api/form.js
firebase-admin
and use the library inside the API routeExpected behavior
The build should not break after adding and using 3rd party dependencies like
firebase-admin
in the API routes. These libraries should be accessible in the generated lambda functions.Versions
Related issues:, there seems to be a possible workaround for netlify-lambda but not if the project uses nextjs which is the main point of the issue netlify/netlify-lambda#112
Attached logs:
The text was updated successfully, but these errors were encountered: