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
Unable to deploy this library on Netlify or next-serverless, cannot resolve 'fast-crc32c' #236
Comments
I haven't looked at this closely yet, but it might be related to #207. |
Importing Node Dependencies in Client BuildsThis is the same issue as in this SO question and the answer within applies here. The same issue happens on my fork mentioned in #207 - this has nothing to do with the distribution. There's this: vercel/next.js#20487 (comment) And also related: vercel/next.js#4940 |
@uncvrd I would actually recommend filing this issue on the NextJS Repo. |
Yes, it looks like Unless that changes in Next.js, I don't think we'll support it here. |
No problem, thanks for looking in to it |
@uncvrd I am using the serverless component : And I ran into your issue. Did you found a solution in-order-to build the nextjs application into a serverless environment ? Thanks. |
@izio38 technically you can fork the project comment out any references to firebase-admin where it's imported (removing the local dependency of fb admin in your project too) and it'll build / deploy. OR you can just manually install the node dependencies required. But highly do not recommend as collaboration will be a pain as theyll not auto install with 'npm i'. But I just switched to Vercel instead and it works great |
Describe the bug
Unfortunately, it appears that this library cannot be built when the
next.config.js
defines atarget: serverless
. An error occurs stating the following:Both
next-serverless
andnetlify
require defining the target asserverless
to be deployed using their libraries/services. Apparentlytarget: serverless
deploys an individual lambda for each page that needs it and I guess thefirebase-admin
package that relies onhash-stream-validation
expects a nodejs environment to execute properly and cannot be bundled with webpack? I'm not an expert but that's sort of what I've picked up and I hope someone with more knowledge in this area can pick up from here.Version
0.13.2
To Reproduce
example
directory found in this repotarget: serverless
to thenext.config.js
npm run build
Expected behavior
I expect to be able to build my project using
target: serverless
without errors so I can deploy on services such as Netlify or onnext-serverless
.Additional context
I apologize as I do not have a solution for this issue, there was a ticket opened and promptly closed in this repo regarding the same problem with no resolution here:
#235
Also a Discussion opened with no response here:
#225
So I figured I'd open this and actively contribute to figuring out the problem with others here. Please let me know what I can do to help!
Edit: As an aside, I suppose it makes sense right? When I install
firebase-admin
to my next app, it detects it's not a server environment so dependencies such asfast-crc32c
are not installed in mynode_modules
like they are for anexpress
app. That's why I receive theModule not found
error. The question now is, how do we prevent webpack from throwing an error when attempting to build the project since it detects that missing dependency?A workaround is to just manually install the
fast-crc32c
package, however this does not work well when sharing projects to team members as they'll need to manually install the packages after a traditionalnpm install
...just a thought.The text was updated successfully, but these errors were encountered: