Closed JanTrichter closed 1 year ago
I haven't tried these steps specifically, but I have been noticing that sometimes the css isn't loading. It's really odd because I can see the webpack output that says it's there but trying to browse the css file directly doesn't serve it up (the error is because webpack sends an html page for the error and thus it isn't a css mime type).
Thanks for the suggested workaround I'll look at incorporating this into the template.
@millerds If you incorporate this, you would also need to update the docs accordingly otherwise it will cause tons of confusion.
I think the error is also only occurring when running the dev-server. Building the project with npm run build
will not cause an error - or at least I haven't experienced that yet.
The css loading was due to the hot reloading taking place and not including the css file. the templates have been updated to fix this.
Expected behavior
Project should start and load all files when running
npm run start
.Current behavior
When I run
npm run start
in my current project I get no css file sometimes. The project sideloads correctly but Webpack references a stylesheet that doesn't exist (although it should).Steps to Reproduce
action
function in thecommands.ts
with:this will spawn a new dialog in which we use the dialog.html file.
npm run start
and observe if the css is included or not (it might work sometimes)Context
package.json
):Failure Logs
The console actually said that the stylesheet had the wrong MIME-type though there wasn't any stylesheet available (webpack linked a stylesheet with a hashed name though).
Error in the debugging console:
Fix
I fixed this issue by:
installing style loader and css loader plugins:
updating the
webpack.config.js
with the loader:importing the stylesheet in my
dialog.ts
I never encountered this error before so I was a bit confused when I saw this but my workaround fixed it. Maybe this should be integrated in the template by default?