I just created a new astro application and attempt to add a scoped <style> section but when using 'npm run dev' I am unable to see the style changes. I deployed the style changes up to my hosting platform and can see my style changes there... What am I missing that is not allowing me to view my style changes locally on the dev server?
#Styling not applied on dev server
37 messages · Page 1 of 1 (latest)
What version of Astro are you on and what operating system?
There was an issue like this not too long ago that only happened on Windows on certain configurations
But it has been fixed since, though
I’m on Astro version 3.4.0 on windows 10
I’ll try on another machine and see if it works there
so I tried on a different machine and everything worked as expected
create astro options used:
- ./sample-astro
- Empty
- [install dependencies] Yes
- [install typescript] Yes
- Strict
- [initialize repo] Yes
Working Environment
Astro Version: v3.4.0
OS Version: Windows 10 21H2 (OS Build 19044.3570)
Node Version: v18.18.0
Failing Environment
Astro Version: v3.4.0
OS Version: Windows 10 22H2 (OS Build 19045.3570)
Node Version: v20.9.0 (also tried v18.18.2)
let me know if there are any other relevant details I can help provide
cc @rancid lintel who worked on the fix
a few things you could try to help debug this
- run
ECHO %cd%(the issue i fixed had to do with lowercase drive letters) - run
node node_modules/astro/astro.js dev(maybe you had astro globally installed) - run using powershell, instead of cmd (i've only known an issue that happened with cmd)
- echo %cd% returns “C:\Users\person\Source\repos\sample-repo
- tried this with no success
- I actually was using powershell previously but tried cmd with no success
I am trying both edge and chrome when viewing the dev output but nothing seems to work
could you share screenshots
terminal, browser, and dev tools - elements and console
sure one moment
just tested ISE same thing
It works from command prompt!!!!
that is so strange
and with the default cmd terminal
basically looking for differences between the two
importantly the one for lang.css
well it isnt the same issue as the last time
but luckily we found a workaround much sooner
i see that as an absolute win
yea I can definitely use this workaround for now