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

ESBuild failures related to farmhash on firebase-admin v12.1.0 #2542

Closed
infovore opened this issue May 1, 2024 · 7 comments
Closed

ESBuild failures related to farmhash on firebase-admin v12.1.0 #2542

infovore opened this issue May 1, 2024 · 7 comments

Comments

@infovore
Copy link

infovore commented May 1, 2024

Environment

  • Operating System version: Mac OS Ventura (13.x) on Intel
  • Firebase SDK version: firebase-admin v12.1.0)
  • Firebase Product: firebase-admin for node
  • Node.js version: 20.5.1
  • NPM version: 9.8.0

Problem

Steps to reproduce:

Starting work on a colleague's project, I run npm install. We've pinned firebase-admin to ^12.0.0; this installs 12.1.0. This works correctly.

When I build my SvelteKit project - which will eventually use ESBuild - I get the same errors as reported in this StackOverflow post - "can't resolve build/Debug/farmhash.node".

When I pin firebase-admin to 12.0.0 (specific version): no such error. So the StackOverflow post, filed a day or two ago, seems to be related to something in the 12.1.0 changes.

Beyond this, I'm a bit lost, but managed to find evidence of someone else with the same issue, and now have a workaround - pinning to an old verison. There seem to have been other farmhash issues that Doug Stevneson has mentioned.

@google-oss-bot
Copy link

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@wodCZ
Copy link

wodCZ commented May 1, 2024

Could be related to this: lovell/farmhash#48

Edit, sorry, probably not, since you're on Intel.

@infovore
Copy link
Author

infovore commented May 1, 2024

Update: farmhash needs to be specified as an ESBuild external. In the case of svelte-adapter-appengine, that was an extra configuration step I hadn't configured, is all.

@infovore infovore closed this as completed May 1, 2024
@balloman
Copy link

balloman commented May 4, 2024

@infovore can you talk a little bit more about what you did? I reverted to 12.0.0, but I'm hoping this doesn't prevent me from upgrading indefinitely

@infovore
Copy link
Author

infovore commented May 5, 2024

@balloman of course - I added farmhash to the externals section of my esbuild configuration.

Vite - in optimizeDeps.externals - and other build tools should have similar configuration options.

@ramigabai
Copy link

Did anyone made it work with @nx/esbuild ? Adding "external": [ "farmhash" ] doesn't work..

@dantheli
Copy link

I'm also facing this with Next.js and had to downgrade to 12.0.0 in order to build as well.

@firebase firebase locked as resolved and limited conversation to collaborators May 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants