-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Pug error in dependency requires restart of webpack #14
Comments
Hello @XenoBino, thank You for the report.
Seems this is Pug compiler error, not pug-loader. |
i get that error too when there is e.g. a syntax error in a javascript snippet in the pug template. the overall problem with error handling ("requires restart") seems to be that the loader / pug can't resolve the dependencies anymore and thus webpack does not watch the files anymore. Only the entrypoint is still being watched, saving that one will trigger a rebuild. One has to know that though. Other loaders have / had this problem too. E.g. simlpe-pug-loader adds at least the file where the error happened, even if not ideal it does help. A mechanism to remember the dependencies and keep watching them on error would be ideal though. |
@m10 Thanks for explaining the problem. This helps me to start researching the problem. |
I checked the source and @webdiscus/pug-loader does in fact add the error file as dependency. For some reason this does not seem to work for this kind of error. Maybe pug does not return any filename in this case.. Line 167 in b430032
|
Could you please show your short snippets of Pug:
|
@m10 @XenoBino - const str = /.+/$ ReproduceWe need two Pug files:
h1 Index
include dependency
h1 Dependency
//- This line is invalid and generates an error
- const str = /.+/$ When an invalid code is in included |
@webdiscus i can confirm that the newest version The error message ist still confusing though. Should that be tracked in a separate issue? |
Yes, please new issue/enhancement create in a separate issue, inc. your error message completely. |
I am facing a non reproducible issue where:
Doesn't go even if I comment the whole file. It requires me to restart the webpack dev server instance. My build is CPU intensive. It takes about half a minute to have something on the screen and caching is not working properly. I have to wait half a minute every time a pug error occurs. And pug errors are extremely unreadable. Making it even harder to fix the pug error.
The text was updated successfully, but these errors were encountered: