Skip to content

Firebase emulate & Build race condition leads to missing index.js #59

Description

@Sandbye

Sometimes when unlucky tsdown will clean the dist at the same time that the emulator is checking for the dist/index.js file, which leads to it not being served correctly, requiring an additional save. It was not easy to replicate this in this smaller project, but in a bigger project a build can take longer than the hot-reload from firebase.

Two separate solutions i have found for now:

  • Have firebase emulate have its own watch, instead of turbo. Applying concurrently.
    or
  • Have tsdown config clean set to false

I am not sure if any of these solutions are that graceful, would be nice if we could avoid concurrently, or setting clean to false, to avoid dist changes not being applied to the serve correctly.

It does not seem possible to change how firebase hot-reloads, apart from changing the source in firebase.json to the dist folder, but requires more tweaking, and probably unwanted changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions