Skip to content

Error in sass_compile_data_context() #525

Open
@wch

Description

@wch

We've found that some C-level errors cause webR to stop working correctly.

Here's an example:

install.packages("sass")
library(sass)

sass("
$primary-color: #333;
body {
  color: $primary-color;
}
")

# After this line in webR, the terminal will be unresponsive
sass("this will error")

In normal R, this is what shows:

> sass("this will error")
Error in compile_data(sass_input, options) : 
  Error: Invalid CSS after "this will error": expected "{", was ""
        on line 1:16 of stdin
>> this will error
   ---------------^

If it's run in https://webr.r-wasm.org/latest/, then the terminal freezes. There is also an uncaught error in the JS console.

Image

For reference, this is the compile_data() C function: https://github.com/rstudio/sass/blob/d9fe9716de08384797a82f9db945587c0243a35d/src/compile.c#L113-L140

cc @gadenbuie

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions