Skip to content
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

Fatal error with sass@1.32.x when Deprecation Warning is raised. #914

Closed
jsg2021 opened this issue Jan 12, 2021 · 9 comments · Fixed by #915
Closed

Fatal error with sass@1.32.x when Deprecation Warning is raised. #914

jsg2021 opened this issue Jan 12, 2021 · 9 comments · Fixed by #915

Comments

@jsg2021
Copy link

jsg2021 commented Jan 12, 2021

  • Operating System: linux
  • Node Version: 14.15.3
  • NPM Version: 7.4.0
  • webpack Version: 4.46.0
  • sass-loader Version: 10.1.1

Expected Behavior

Raise the warning in webpack without crashing.

Actual Behavior

Webpack crashes.

How Do We Reproduce?

in a sass file, use a color value of hsla(0,0,0, 0.025).
if you run the sass cli on it:

sass ./node_modules/foundation-sites/scss/foundation.scss ./tmp.css
Deprecation Warning: $saturation: Passing a number without unit % (0) is deprecated.

To preserve current behavior: $saturation * 1%

   ╷
25 │ $side-nav-link-bg-hover: hsla(0, 0, 0%, 0.025) !default;
   │                          ^^^^^^^^^^^^^^^^^^^^^
   ╵

webpack prints this and a long stack trace and dies:

ModuleBuildError: Module build failed (from ../node_modules/sass-loader/dist/cjs.js):
SassError: NoSuchMethodError: method not found: 'get$span' on null
   ╷
25 │ $side-nav-link-bg-hover: hsla(0, 0, 0%, 0.025) !default;
   │                          ^^^^^^^^^^^^^^^^^^^^^
   ╵
@alexander-akait
Copy link
Member

This deprecation error from sass, please fix problem in core, we can't fix it on our side, sorry

@jsg2021
Copy link
Author

jsg2021 commented Jan 13, 2021

The deprecation warning is being miss read by sass-loader? it works as expected when used by their cli?

@alexander-akait
Copy link
Member

hm, weird, SassError: NoSuchMethodError: method not found: 'get$span' on null means, dart-sass/node-sass throws the error, give me couple minutes to investigate

@alexander-akait
Copy link
Member

@jsg2021 weird, can't reproduce, can you check verison of dart-sass or provide simple reproducible test repo?

@alexander-akait
Copy link
Member

Tests - #915

@alexander-akait
Copy link
Member

Maybe you have globally installed version is newer than in local node_modules

@jsg2021
Copy link
Author

jsg2021 commented Jan 13, 2021

As I isolate parts, it stops reproducing... very strange. If I set fiber: false in my main project the warning is not even caught by the loader and is directly printed to the console and webpack does not know there was a warning. Actually, in isolation, that's what happens too... webpack is not aware there was a warning. Maybe this is a race condition and needs more files to process?

@alexander-akait
Copy link
Member

If I set fiber: false in my main project the warning is not even caught by the loader and is directly printed to the console

sass doesn't allow to set custom loggers, so expected

Maybe this is a race condition and needs more files to process?

It means bug inside fiber

@jsg2021
Copy link
Author

jsg2021 commented Jan 13, 2021

I think you are correct, in that there isn't an error in sass-loader. I think the we can catch it though... it looks like it's thrown when the SassError toStrings the original error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants