(Node) Refused to apply style because its MIME type 'text html' is not a supported stylesheet (FIX)

preview_player
Показать описание
Hi, I'm Wesley. I'm a brand ambassador for Kinde (paid sponsorship). I'll help you master the latest tech here:

👉 Discord: all my courses have a private Discord where I actively participate

0:00 Solution

#webdevelopment #coding #programming
Рекомендации по теме
Комментарии
Автор

Hey great video but after doing this, I stoped getting that error but, I tried using eventListeners and onclick functions on my button in my form but got this new error instead:
Refused to execute inline event handler because it violates the following Content Security Policy directive

JagTheRipper
Автор

thank you so much... all I had to do was put that first slash and all were solved

Onesmo
Автор

A million videos and this is the one that helped me, thank you!

NigelWatkins-pg
Автор

That was my exact issue running Node.js. These 2 fixed it: var path = require('path');
app.use(express.static(path.join(__dirname, 'public'))); Thank you!

JohnSleeper
Автор

Simple and straight Thank you very much Bless you

sibtycodes
Автор

Finally, after trying to solve this issue for 3 hours. Thanks!

mihaelh
Автор

basically just remove /public or /views from indez.ejs even if u click and it doesnt open the desired css file because u have said public or views path in sever.js or in express.static. if u do not remove it than the node will take the path as /dist/dist/output, css instead of /dist/output.css beacuse u mentioned dist or public twice once in express, static and once again in index.ejs href place. hope this helps

Irshad-Mohammed
Автор

Thank you so much had been stuck at this since 20min

harshitjoshi
Автор

Nice and simple, fixed my issue straight away. Thank you!

alexjakeman
Автор

I'm getting this error on angular, where is this app.js file located? Our do i need to create it?

playdagameythd
Автор

thanks a lot man, I was almost losing my mind 🤯

yanvaladares
Автор

It worked. thanks sir, have a great day

harogomo
Автор

Thank you So simple You rock!! Coming back for more soon :P

cronosakroma
Автор

Pls do for image found in another folder the link won't work for me pls

ngomedonnel
Автор

what to do if the css file in the same folder of html file and there are images as well used in css
then what need to write please tell

sudhanshukushwaha
Автор

you are incredible thanks a lot man thanks a lot

luisubillus
Автор

After 1 hr of efforts i realised that I've mentioned style.css in my href, but i created styles.css file in my public folder 🥲🥲🥲

vinayb