Skip to content

Handle non-existing styles more gracefully #166

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

Closed
illright opened this issue Jun 5, 2020 · 1 comment
Closed

Handle non-existing styles more gracefully #166

illright opened this issue Jun 5, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@illright
Copy link
Contributor

illright commented Jun 5, 2020

Describe the bug
Currently, <style src="doesnt/exist.scss"></style> will compile into <style src="doesnt/exist.scss">undefined</style>, which crashes the Svelte style parser. It would be nice to handle such situations by simply creating an empty style tag, emitting an error message in the console, that way at least the server runs.

To Reproduce

  • get a fresh Svelte app template
  • install svelte-preprocess and node-sass
  • add autoPreprocess to rollup.config.js
  • in src/App.svelte, remove the content of the <style> tag and add src="doesnt/exist.scss"
  • run the development server

Expected behavior
The server should run without crashing, warning the developer about the error.

Additional context
Not sure if the same problem persists with other style processors and other script or markup processors, for that matter. Also not sure if this is intended behaviour.

The reason for this request is that in some cases, crashing a server makes Rollup lose track of dependencies, not rebuilding even after one fixes the faulty path

kaisermann added a commit that referenced this issue Jun 6, 2020
@kaisermann kaisermann self-assigned this Jun 6, 2020
@kaisermann kaisermann added the bug Something isn't working label Jun 6, 2020
@kaisermann
Copy link
Member

Hey @illright 👋 Thanks for the report. Silly mistake from my part 😁

Fixed in v3.9.2 🎉

kaisermann added a commit that referenced this issue Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants