sass/dart-sass-embedded

fileImportRequest does not have id set

ntkme opened this issue · 1 comments

ntkme commented
require 'sass-embedded'

10.times do
  Thread.new do
    Sass.compile_string('@import "not-found.scss"', importers: [{ find_file_url: ->(*) { sleep 1; nil } }])
  end
end

Thread.list.each do |t|
  t.join unless t == Thread.current
end

Verbose log:

Sending: <Sass::EmbeddedProtocol::InboundMessage: compile_request: <Sass::EmbeddedProtocol::InboundMessage::CompileRequest: id: 0, style: :EXPANDED, source_map: false, importers: [<Sass::EmbeddedProtocol::InboundMessage::CompileRequest::Importer: file_importer_id: 0>], global_functions: [], alert_color: true, alert_ascii: false, verbose: false, quiet_deps: false, source_map_include_sources: false, string: <Sass::EmbeddedProtocol::InboundMessage::CompileRequest::StringInput: source: "@import "not-found.scss"", url: "", syntax: :SCSS>>>
Sending: <Sass::EmbeddedProtocol::InboundMessage: compile_request: <Sass::EmbeddedProtocol::InboundMessage::CompileRequest: id: 1, style: :EXPANDED, source_map: false, importers: [<Sass::EmbeddedProtocol::InboundMessage::CompileRequest::Importer: file_importer_id: 0>], global_functions: [], alert_color: true, alert_ascii: false, verbose: false, quiet_deps: false, source_map_include_sources: false, string: <Sass::EmbeddedProtocol::InboundMessage::CompileRequest::StringInput: source: "@import "not-found.scss"", url: "", syntax: :SCSS>>>
Sending: <Sass::EmbeddedProtocol::InboundMessage: compile_request: <Sass::EmbeddedProtocol::InboundMessage::CompileRequest: id: 2, style: :EXPANDED, source_map: false, importers: [<Sass::EmbeddedProtocol::InboundMessage::CompileRequest::Importer: file_importer_id: 0>], global_functions: [], alert_color: true, alert_ascii: false, verbose: false, quiet_deps: false, source_map_include_sources: false, string: <Sass::EmbeddedProtocol::InboundMessage::CompileRequest::StringInput: source: "@import "not-found.scss"", url: "", syntax: :SCSS>>>
Sending: <Sass::EmbeddedProtocol::InboundMessage: compile_request: <Sass::EmbeddedProtocol::InboundMessage::CompileRequest: id: 3, style: :EXPANDED, source_map: false, importers: [<Sass::EmbeddedProtocol::InboundMessage::CompileRequest::Importer: file_importer_id: 0>], global_functions: [], alert_color: true, alert_ascii: false, verbose: false, quiet_deps: false, source_map_include_sources: false, string: <Sass::EmbeddedProtocol::InboundMessage::CompileRequest::StringInput: source: "@import "not-found.scss"", url: "", syntax: :SCSS>>>
Sending: <Sass::EmbeddedProtocol::InboundMessage: compile_request: <Sass::EmbeddedProtocol::InboundMessage::CompileRequest: id: 4, style: :EXPANDED, source_map: false, importers: [<Sass::EmbeddedProtocol::InboundMessage::CompileRequest::Importer: file_importer_id: 0>], global_functions: [], alert_color: true, alert_ascii: false, verbose: false, quiet_deps: false, source_map_include_sources: false, string: <Sass::EmbeddedProtocol::InboundMessage::CompileRequest::StringInput: source: "@import "not-found.scss"", url: "", syntax: :SCSS>>>
Sending: <Sass::EmbeddedProtocol::InboundMessage: compile_request: <Sass::EmbeddedProtocol::InboundMessage::CompileRequest: id: 5, style: :EXPANDED, source_map: false, importers: [<Sass::EmbeddedProtocol::InboundMessage::CompileRequest::Importer: file_importer_id: 0>], global_functions: [], alert_color: true, alert_ascii: false, verbose: false, quiet_deps: false, source_map_include_sources: false, string: <Sass::EmbeddedProtocol::InboundMessage::CompileRequest::StringInput: source: "@import "not-found.scss"", url: "", syntax: :SCSS>>>
Sending: <Sass::EmbeddedProtocol::InboundMessage: compile_request: <Sass::EmbeddedProtocol::InboundMessage::CompileRequest: id: 6, style: :EXPANDED, source_map: false, importers: [<Sass::EmbeddedProtocol::InboundMessage::CompileRequest::Importer: file_importer_id: 0>], global_functions: [], alert_color: true, alert_ascii: false, verbose: false, quiet_deps: false, source_map_include_sources: false, string: <Sass::EmbeddedProtocol::InboundMessage::CompileRequest::StringInput: source: "@import "not-found.scss"", url: "", syntax: :SCSS>>>
Sending: <Sass::EmbeddedProtocol::InboundMessage: compile_request: <Sass::EmbeddedProtocol::InboundMessage::CompileRequest: id: 7, style: :EXPANDED, source_map: false, importers: [<Sass::EmbeddedProtocol::InboundMessage::CompileRequest::Importer: file_importer_id: 0>], global_functions: [], alert_color: true, alert_ascii: false, verbose: false, quiet_deps: false, source_map_include_sources: false, string: <Sass::EmbeddedProtocol::InboundMessage::CompileRequest::StringInput: source: "@import "not-found.scss"", url: "", syntax: :SCSS>>>
Sending: <Sass::EmbeddedProtocol::InboundMessage: compile_request: <Sass::EmbeddedProtocol::InboundMessage::CompileRequest: id: 8, style: :EXPANDED, source_map: false, importers: [<Sass::EmbeddedProtocol::InboundMessage::CompileRequest::Importer: file_importer_id: 0>], global_functions: [], alert_color: true, alert_ascii: false, verbose: false, quiet_deps: false, source_map_include_sources: false, string: <Sass::EmbeddedProtocol::InboundMessage::CompileRequest::StringInput: source: "@import "not-found.scss"", url: "", syntax: :SCSS>>>
Sending: <Sass::EmbeddedProtocol::InboundMessage: compile_request: <Sass::EmbeddedProtocol::InboundMessage::CompileRequest: id: 9, style: :EXPANDED, source_map: false, importers: [<Sass::EmbeddedProtocol::InboundMessage::CompileRequest::Importer: file_importer_id: 0>], global_functions: [], alert_color: true, alert_ascii: false, verbose: false, quiet_deps: false, source_map_include_sources: false, string: <Sass::EmbeddedProtocol::InboundMessage::CompileRequest::StringInput: source: "@import "not-found.scss"", url: "", syntax: :SCSS>>>
Receiving: <Sass::EmbeddedProtocol::OutboundMessage::FileImportRequest: id: 0, compilation_id: 0, importer_id: 0, url: "not-found.scss", from_import: true>
Receiving: <Sass::EmbeddedProtocol::OutboundMessage::FileImportRequest: id: 0, compilation_id: 1, importer_id: 0, url: "not-found.scss", from_import: true>
Receiving: <Sass::EmbeddedProtocol::OutboundMessage::FileImportRequest: id: 0, compilation_id: 2, importer_id: 0, url: "not-found.scss", from_import: true>
Receiving: <Sass::EmbeddedProtocol::OutboundMessage::FileImportRequest: id: 0, compilation_id: 3, importer_id: 0, url: "not-found.scss", from_import: true>
Receiving: <Sass::EmbeddedProtocol::OutboundMessage::FileImportRequest: id: 0, compilation_id: 4, importer_id: 0, url: "not-found.scss", from_import: true>
Receiving: <Sass::EmbeddedProtocol::OutboundMessage::FileImportRequest: id: 0, compilation_id: 5, importer_id: 0, url: "not-found.scss", from_import: true>
Receiving: <Sass::EmbeddedProtocol::OutboundMessage::FileImportRequest: id: 0, compilation_id: 6, importer_id: 0, url: "not-found.scss", from_import: true>
Receiving: <Sass::EmbeddedProtocol::OutboundMessage::FileImportRequest: id: 0, compilation_id: 7, importer_id: 0, url: "not-found.scss", from_import: true>
Receiving: <Sass::EmbeddedProtocol::OutboundMessage::FileImportRequest: id: 0, compilation_id: 8, importer_id: 0, url: "not-found.scss", from_import: true>
Receiving: <Sass::EmbeddedProtocol::OutboundMessage::FileImportRequest: id: 0, compilation_id: 9, importer_id: 0, url: "not-found.scss", from_import: true>
Sending: <Sass::EmbeddedProtocol::InboundMessage: file_import_response: <Sass::EmbeddedProtocol::InboundMessage::FileImportResponse: id: 0>>
Sending: <Sass::EmbeddedProtocol::InboundMessage: file_import_response: <Sass::EmbeddedProtocol::InboundMessage::FileImportResponse: id: 0>>
Sending: <Sass::EmbeddedProtocol::InboundMessage: file_import_response: <Sass::EmbeddedProtocol::InboundMessage::FileImportResponse: id: 0>>
Sending: <Sass::EmbeddedProtocol::InboundMessage: file_import_response: <Sass::EmbeddedProtocol::InboundMessage::FileImportResponse: id: 0>>
Sending: <Sass::EmbeddedProtocol::InboundMessage: file_import_response: <Sass::EmbeddedProtocol::InboundMessage::FileImportResponse: id: 0>>
/usr/local/bundle/gems/sass-embedded-1.2.3/lib/sass/embedded/compiler.rb:19: warning: Host caused params error: Response ID 0 doesn't match any outstanding requests.
Receiving: <Sass::EmbeddedProtocol::ProtocolError: type: :PARAMS, id: 4294967295, message: "Response ID 0 doesn't match any outstanding requests.">
Sending: <Sass::EmbeddedProtocol::InboundMessage: file_import_response: <Sass::EmbeddedProtocol::InboundMessage::FileImportResponse: id: 0>>
#<Thread:0x00007d92dec66210 test.rb:4 run> terminated with exception (report_on_exception is true):
: Response ID 0 doesn't match any outstanding requests. (Sass::CompileError)
        from /usr/local/bundle/gems/sass-embedded-1.2.3/lib/sass/embedded/async.rb:53:in `synchronize'
        from /usr/local/bundle/gems/sass-embedded-1.2.3/lib/sass/embedded/async.rb:53:in `await'
        from /usr/local/bundle/gems/sass-embedded-1.2.3/lib/sass/embedded/host.rb:135:in `block in await'
        from /usr/local/bundle/gems/sass-embedded-1.2.3/lib/sass/embedded/host.rb:129:in `synchronize'
        from /usr/local/bundle/gems/sass-embedded-1.2.3/lib/sass/embedded/host.rb:129:in `await'
        from /usr/local/bundle/gems/sass-embedded-1.2.3/lib/sass/embedded/host.rb:43:in `compile_request'
        from /usr/local/bundle/gems/sass-embedded-1.2.3/lib/sass/embedded.rb:199:in `compile_string'
        from /usr/local/bundle/gems/sass-embedded-1.2.3/lib/sass/embedded.rb:45:in `compile_string'
        from test.rb:5:in `block (2 levels) in <main>'
#<Thread:0x00007d92dec64bb8 test.rb:4 run> terminated with exception (report_on_exception is true):
/usr/local/bundle/gems/sass-embedded-1.2.3/lib/sass/embedded/async.rb:56:in `block in await': Response ID 0 doesn't match any outstanding requests. (Sass::CompileError)
        from /usr/local/bundle/gems/sass-embedded-1.2.3/lib/sass/embedded/async.rb:53:in `synchronize'
        from /usr/local/bundle/gems/sass-embedded-1.2.3/lib/sass/embedded/async.rb:53:in `await'
        from /usr/local/bundle/gems/sass-embedded-1.2.3/lib/sass/embedded/host.rb:135:in `block in await'
        from /usr/local/bundle/gems/sass-embedded-1.2.3/lib/sass/embedded/host.rb:129:in `synchronize'
        from /usr/local/bundle/gems/sass-embedded-1.2.3/lib/sass/embedded/host.rb:129:in `await'
        from /usr/local/bundle/gems/sass-embedded-1.2.3/lib/sass/embedded/host.rb:43:in `compile_request'
        from /usr/local/bundle/gems/sass-embedded-1.2.3/lib/sass/embedded.rb:199:in `compile_string'
        from /usr/local/bundle/gems/sass-embedded-1.2.3/lib/sass/embedded.rb:45:in `compile_string'
        from test.rb:5:in `block (2 levels) in <main>'
ntkme commented

I had a huge misunderstand about the issue, PR coming.