Comments (7)
@esb https://rubygems.org/gems/sass-embedded/versions/1.77.1 has been released. Please give it a try.
from dart-sass.
I have tested 1.77.1 in my environment and can report that the issue appears to have been resolved.
from dart-sass.
irb(main):001> require 'sass-embedded'
=> true
irb(main):002> puts Sass.info
sass-embedded 1.77.0 (Embedded Host) [Ruby]
dart-sass 1.77.0 (Sass Compiler) [Dart]
=> nil
irb(main):003> puts Sass.compile_string('$white: #fff !default;').css
=> nil
I cannot reproduce your concern. Can you please provide more details on how you're running sass, and if you have more sass files?
from dart-sass.
Null check operator used on a null value
is indeed an error on Dart side, and the only code path changed between 1.75 and 1.77 where I see a null check operator is here:
dart-sass/lib/src/util/map.dart
Lines 22 to 24 in 85f39d5
This code path is used for importer caching. So for us to help you we really need to know how you're invoking Sass. Are you using dartsass-rails
or dartsass-sprockets
and how do you run sass?
from dart-sass.
This is part of a massive Rails build using Sprockets and sassc.
The gems being used are
dartsass-sprockets (3.1.0)
sass-embedded (1.76.0 x86_64-linux-gnu)
sassc (2.4.0)
sassc-embedded (1.76.0)
The sass code that's throwing the crash comes from @UPPY, so I have the following import statement which causes the crash. This file imports another file with a bunch of variable initializations using the !default syntax.
@import '@uppy/core/src/style.scss';
I'm not sure how to break it down more than that. Everything works at 1.75.0 and then breaks with 1.76.0 and 1.77.0.
Error: Null check operator used on a null value
╷
1 │ @import '@uppy/core/src/_variables.scss';
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
╵
/vagrant/node_modules/@uppy/core/src/_utils.scss 1:9 @import
/vagrant/node_modules/@uppy/dashboard/src/style.scss 1:9 @import
/vagrant/app/assets/stylesheets/toolbox.scss.erb 82:9 root stylesheet
from dart-sass.
Here is a bare minimum reproduction with embedded-host-node:
npm i sass-embedded @uppy/core
const sass = require('sass-embedded')
const input = `
@import '@uppy/core/src/style';
@import '@uppy/core/src/style';
`;
sass.compileString(input, {
importers: [
{
findFileUrl () {
return null
}
}
],
loadPaths: ['does_not_resolve', 'node_modules']
})
Very same reproduction for embedded-host-ruby:
require 'sass-embedded'
input = <<~SCSS
@import '@uppy/core/src/style';
@import '@uppy/core/src/style';
SCSS
begin
Sass.compile_string(
input,
importers: [
{ find_file_url: ->(*) {} }
],
load_paths: ['does_not_resolve', 'node_modules']
)
rescue Sass::CompileError => e
puts e.full_message
end
from dart-sass.
@nex3 Actually the bug is more than just this... In summary the condition is that:
- First importer is not cacheable, returning null.
- Second importer load path returning null.
- Third importer load path resolves.
- The same file is loaded the second time in the same way, exercising the cache.
In the ruby host we crash in the test case above because I delayed the implementation of tracking access of containing_url, and the first condition met. However, in embedded-host-node, it met the first condition because I forget to setting containingUrlUnused
on this line: https://github.com/sass/embedded-host-node/blob/bce32f3e8f29494c0a64dd2b4c23cfdc48ec7880/lib/src/importer-registry.ts#L212
Preparing a PR right now.
from dart-sass.
Related Issues (20)
- Does sass encourage terrorism, kidnapping, murder and rape?
- ImportCache of CanonicalizeResult is broken for relative imports handled by any importer that is not a baseImporter HOT 13
- {DELETE ME] HOT 1
- Running Dart Sass in QuickJS? HOT 4
- Unused code elimination and deduplication is not applied when using api: 'legacy' HOT 5
- font-awesome integration HOT 8
- I would like to know which version of dart-sass supports node v10.18.0? HOT 1
- At-rules may not be used within keyframe blocks HOT 1
- "braces" dependency vulnerable to "Uncontrolled resource consumption" CVE HOT 2
- --silence-deprecation doesn't work on the CLI HOT 1
- CLI Many-to-Many Mode process .css files HOT 2
- Converting .sass to .scss? HOT 1
- Add WASM compilation target HOT 2
- @use file cannot use variables starting with $-- HOT 1
- Setup arm64 linux/windows runners for AOT releases HOT 5
- dart-sass maven plugin 1.77.4 is not a Win32 valid application HOT 4
- Silent comments are incorrectly preserved in at-rule values
- NPM Pack is failing for version 1.62.1 HOT 1
- Install defaults to C:/Tools on Windows!!! HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dart-sass.