Skip to content

bug: globalStyle failing HMR on Windows #4961

Closed

Description

@4leite

Prerequisites

Stencil Version

4.5.0

Current Behavior

Stencil in watch mode does not rebuild when config.globalStyle is updated on windows.

Expected Behavior

Changing config.globalStyle should trigger a rebuild.

System Info

Latest Windows (this is relevant because the bug will not be present on linux).

Steps to Reproduce

npm run start
make a change to /src/global.css eg change "--color-primary: red;" to blue.
change is not reflected in browser.

Code Reproduction URL

https://github.com/Datacom-Digital/stencil-bug

Additional Information

This is because buildCtx.filesChanged is normalised but config.globalStyle is not so the string compare fails. This is probably effecting imports as well however i don't use them in my project so haven't checked.

See #4898 for the patch that fixed the issue for me.

Activity

  1. self-assigned this
    on Oct 23, 2023
  2. added
    Bug: Validated
    on Oct 23, 2023
  3. changed the title [-]bug: [/-] [+]bug: globalStyle failing HMR on Windows[/+] on Oct 23, 2023
  4. 4leite commented on Oct 26, 2023

    @4leite
    Author

    @rwaskiewicz this effects both watch and regular build (it's not an HMR issue), it's a file diff problem.

    I am happy to raise a PR with the one line fix I linked above that resolves the issue.

  5. rwaskiewicz commented on Oct 26, 2023

    @rwaskiewicz
    Member

    Hey @4leite 👋

    Thanks! I'm planning on working on a fix today - turns out this bug is a little more systemic that just for globalStyle unfortunately 😢

  6. rwaskiewicz commented on Nov 2, 2023

    @rwaskiewicz
    Member

    (Still working on this)

  7. added a commit that references this issue on Nov 9, 2023
    d7d1f7b
  8. rwaskiewicz commented on Nov 9, 2023

    @rwaskiewicz
    Member

    @4leite Thanks for your patience!

    Can you do me a favor and give the following dev build of Stencil a try when you get a chance?

    npm i @stencil/[email protected]
    
  9. added a commit that references this issue on Nov 10, 2023
    bb0b1d4
  10. tanner-reits commented on Nov 13, 2023

    @tanner-reits
    Contributor

    The fix for this went out as a part of today's v4.7.2 release!

  11. 4leite commented on Feb 13, 2024

    @4leite
    Author

    @tanner-reits Sorry took a while to get back on this project. I can confirm that this is resolved for ours with release v4.7.2.
    Thanks.

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

Metadata

Metadata

Assignees

Labels

Bug: Validated

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions