Skip to content

DEPRECATION WARNING: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0. #112

@Asken

Description

@Asken

I'm trying to use latest sass but rollup-plugin-scss doesn't seem to support it as the new function is sass.compileString.

const render = sass.renderSync(

packeges,json

"sass": "^1.77.8",
"rollup": "^4.28.1",
"rollup-plugin-sass": "^1.14.0",
"rollup-plugin-scss": "^4.0.1",

My rollup dev:

import scss from 'rollup-plugin-scss'
...
plugins: [
  scss({
    include: ['src/**/*.scss'],
    output: 'public/bundle-dark.css',
    // insert: true
    data: '@import "src/_theme-dark-variables";',
    compress: true,
  }),
]

Gives the following error message:

DEPRECATION WARNING: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.
[0]
[0] More info: https://sass-lang.com/d/legacy-js-api
[0]
[0] DEPRECATION WARNING: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.
[0]
[0] More info and automated migrator: https://sass-lang.com/d/import

If I instead use rollup-plugin-sass I get a runtime error:

import scss from 'rollup-plugin-scss'
import sass from 'rollup-plugin-sass'
...
plugins: [
  scss({
    include: ['src/**/*.scss'],
    output: 'public/bundle-dark.css',
    // insert: true
    data: '@import "src/_theme-dark-variables";',
    compress: true,
    sass,
  }),
]

Error:

Error:
sass.renderSync is not a function

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions