Skip to content

Script file isn't loaded on start astro dev when using tailwindcss #4217

@kagankan

Description

@kagankan

What version of astro are you using?

1.0.0-rc.8

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

npm

What operating system are you using?

Windows 10

Describe the Bug

Please see my sample repo.

That sample will show:

  1. loading screen
    • script is loaded from src\components\LoadingScreen\LoadingScreen.astro
  2. canvas animation (moving sea picture)
    • script is loaded from src\pages\index.astro

Problem

  1. start astro dev and access local page
  2. loading screen is correctly showed, but canvas animation is not showed.
    • script is not loaded to head tag
  3. once I save src\scenes\main.ts, canvas animation starts moving
    • script is loaded

Case that Works

  1. remove @use "node_modules/tailwindcss/utilities"; from src/styles/style.scss
  2. start astro dev and access local page
  3. working correctly

Additional Notes

I tested some versions.

in 1.0.0-beta.69 ~ 72: working correctly (without removing @use "node_modules/tailwindcss/utilities";)
from 1.0.0-beta.73: the problem occurs.

(Edited)

1.0.0-beta.73 ~ 1.0.0-rc.3:

  1. start astro dev and access local page
  2. canvas animation is not showed.
  3. once I reload , canvas animation start running

1.0.0-rc.4 ~:

  1. start astro dev and access local page
  2. canvas animation is not showed.
  3. reload changes nothing
  4. once I save src\scenes\main.ts, canvas animation starts moving

Link to Minimal Reproducible Example

https://github.com/kagankan/astro-sample/tree/41c58b10d639dbdecd9b020b331fa8ee94517ebc

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

Labels

- P3: minor bugAn edge case that only affects very specific usage (priority)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions