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

next.config.js bundle timeout deploys a broken build #6193

Open
rasendubi opened this issue Jul 27, 2023 · 10 comments
Open

next.config.js bundle timeout deploys a broken build #6193

rasendubi opened this issue Jul 27, 2023 · 10 comments

Comments

@rasendubi
Copy link

rasendubi commented Jul 27, 2023

#5691 introduced a 10s timeout for bundling next.config.js. This bundling uses npx esbuild next.config.js command and it may timeout for a variety of reasons (most likely, network-related).

When this happens, the code fallbacks to copying next.config.js to the output. However, if next.config.js imports any other local file, copying next.config.js is not enough (as the other file needs to be copied as well).

This led to our CI silently deploying a broken build to production (sometimes) which then failed with hard to understand errors.

There are a couple of possible fixes, and I'm not sure which one is better:

  • remove timeout for esbuild
  • add esbuild to firebase-tools' dependencies, so bundling does not depend on network speed
  • in fallback, copy all source files to output
  • in fallback, stop the build

cc @jamesdaniels @leoortizz

[REQUIRED] Environment info

firebase-tools: anything after e5981f2 (11.30.0+)

Platform: any

[REQUIRED] Test case

next.config.js:

require('./other');

module.exports = {};

other.js:

[REQUIRED] Steps to reproduce

  • flush npm/npx cache: rm -rf "$(npm config get cache)/_npx"
  • run env FIREBASE_CLI_EXPERIMENTS=webframeworks firebase deploy
  • loop until fails

[REQUIRED] Expected behavior

It works

[REQUIRED] Actual behavior

SSR is deployed but fails at runtime.

Workaround

The simplest workaround is to add esbuild to your project's dependencies. This will cause npx to use project-installed version, so it can't timeout due to network

@leoortizz
Copy link
Member

Hey @rasendubi, thanks for reporting. I discussed this with @alexastrum and we decided to increase the timeout to 60 seconds to workaround the network issues. It will be available in the next release.

@rasendubi
Copy link
Author

rasendubi commented Aug 2, 2023 via email

@leoortizz
Copy link
Member

leoortizz commented Aug 2, 2023

@rasendubi I understand, I'll follow up with @alexastrum for a long-term solution for this issue

@rasendubi

This comment was marked as resolved.

@rasendubi

This comment was marked as resolved.

@leoortizz
Copy link
Member

Hey @rasendubi, are you still having this issue?

@leoortizz leoortizz added the Needs: Author Feedback Issues awaiting author feedback label Jun 18, 2024
@google-oss-bot
Copy link
Contributor

Hey @rasendubi. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@rasendubi
Copy link
Author

rasendubi commented Jul 9, 2024 via email

@chalosalvador
Copy link
Member

@rasendubi this issue should have been fixed by #7395 would you mind trying it out with the latest version of Firebase CLI and confirm if the issue has been resolved?

@rasendubi
Copy link
Author

rasendubi commented Aug 22, 2024 via email

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

No branches or pull requests

5 participants