Skip to content

HMC: error on css file update #25399

@yukulele

Description

@yukulele

What version of Bun is running?

1.3.4+5eb2145b3

What platform is your computer?

Linux 6.17.0-7-generic x86_64 unknown

What steps can reproduce the bug?

create src/index.css
create index.html containing <link rel="stylesheet" href="src/index.css" /> in <head>

run bun index.html
open http://localhost:3000 in browser
modify src/index.css and save it

What is the expected behavior?

styles should reload without error.

What do you see instead?

Styles do not always reload, and I get an error (console and popup):

Reloaded in 1ms: src/index.css
frontend InvalidAccessError: CSSStyleSheet.cssRules getter: Can't access rules of still-loading style sheet
      at getSourceSheets/< (http://localhost:3000/:390:41)
      at iterateSourceSheets/< (http://localhost:3000/:381:37)
      at iterateSourceSheets (http://localhost:3000/:372:45)
      at getSourceSheets (http://localhost:3000/:388:36)
      at handleSheetChangeForNode (http://localhost:3000/:428:47)
      at set (http://localhost:3000/:541:53)
    from browser tab http://localhost:3000/

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions