#import style.css not working

7 messages · Page 1 of 1 (latest)

fringe hare
#

Hi, I'm new to astro, and I encoutered this problem :
I have a component, and inside of it, I have
`---
import './style.css';

other astro stuff
---`
And my style.css is located in my public folder, according to what I've seen on the docs, this should work, but I get this error:

failed to load module for ssr: ./style.css

Btw yes in my astro config I've enabled ssr :

export default defineConfig({ output: "server", adapter: node({ mode: 'standalone' }) });

copper leaf
#

hi. Imports use a relative path to a file. If you placed the css file in public, I would recommend to just use a link tag

fringe hare
#

what is a link tag ?

copper leaf
#

<link rel="stylesheet" href="mystyle.css">

fringe hare
#

oh sry im dumb

#

okay I'll try that

#

works thanks