Search code examples
firebasenext.jsfirebase-hosting

Firebase Next.js Hosting: Unable to find 'esbuild'


I'm trying to use Firebase's new Next.js support for Hosting (see https://firebase.google.com/docs/hosting/nextjs) but I'm getting a weird error when I try to deploy. (Everything runs correctly in the local emulator suite, btw)

Screenshot of Console output with error

When I try to run firebase deploy --only hosting,functions -m "testing out next.js support" I'm getting the error Unable to find 'esbuild'. Install it into your local dev dependencies with 'npm i --save-dev esbuild''. I've already added esbuild to my dev dependencies, and it seems to be installed correctly. My project uses yarn, not npm, but for the sake of testing I tried install it with npm like the error suggested, but that didn't work either.

Has anyone used Firebase Next.js hosting or figured it out since they've released it? The documentation on that page I linked above is... not great.


Solution

  • Make sure that you are using the latest Firebase Tools as per the documentation: "Firebase CLI version 11.14.2 or later".

    Run npm install -g firebase-tools to update your version.