question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Breaks watch mode on error when preprocess dependency transformation fails

See original GitHub issue

Describe the bug If preprocess fails execution of a dependency (eg: an external scss file imported within a <style> tag). The onLoad returning watchFiles are lost and editing the external scss does not trigger the rebuild.

To Reproduce Steps to reproduce the behavior:

  1. Create a .svelte file with a <style lang="scss"> with an external import @import "./external-file.scss"; with valid syntax.
  2. Start watch mode.
  3. Edit external-file.scss with some invalid syntax.
  4. Rebuild is triggered and fails.
  5. Edit external-file.scss with valid syntax.
  6. Rebuild is not triggered.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • esbuild-svelte version: 0.7.0
  • esbuild version: 0.14.42
  • Svelte preprocessors used (if any): SCSS

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
maxiruanicommented, Jun 1, 2022

I have created a PR ( #132 ). Let me know what you think! Thanks

1reaction
maxiruanicommented, May 31, 2022

Checking the code I thought in a solution to keep the previous build watchFiles based on the “invalidated” cachedFile.dependencies. Due to preprocess nature we can’t get the resolved dependencies by svelte-preprocess.

Another caveat I found is that if the external scss file has invalid syntax from the start, esbuild watch fails and exit the process, but I don’t figure it out how to fix that.

Let me know if you like this solution and I can try to implement it.

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

jest/CHANGELOG.md at main · facebook/jest - GitHub
Pressing a , o , p , q or enter while tests are running in the watch mode, the test run will be...
Read more >
The mesh file exporter could not resolve cyclic dependencies ...
Any ideas on how to fix this error "The mesh file exporter could not resolve cyclic dependencies in overlapping contact regions.
Read more >
API - esbuild
There are two main API calls in esbuild's API: transform and build. ... Use watch mode to re-run esbuild when a file is...
Read more >
The C Preprocessor - Math
The C preprocessor is a macro processor that is used automatically by the C compiler to transform your program before actual compilation.
Read more >
Makoto's preprocessing pipeline - SCCN
2.1.1 Failure to generate eeg_options.m (06/15/2021 updated) ... 17.5 Dependency across the preprocessing stages (07/05/2019 updated); 17.6 SIFT tips.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found