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

[Bug report] Deprecation Warning: Sass @import rules are deprecated in VuePress theme #277

Closed
yhl-186 opened this issue Oct 19, 2024 · 2 comments · Fixed by #276
Closed

Comments

@yhl-186
Copy link

yhl-186 commented Oct 19, 2024

Description

在使用 VuePress 时,我收到了以下关于 Sass @import 的弃用警告:
"sass": "^1.80.3",
"vue": "^3.4.0",
"vuepress": "^2.0.0-rc.7"


  ╷
2 │ @import '@vuepress/plugin-palette/palette';
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
    node_modules\.pnpm\@vuepress+theme-default@2.0.0-rc.55_markdown-it@14.1.0_sass@1.80.3_vuepress@2.0.0-rc.18_@vuep_w6rbselmw7b23k3zh7mmjp3yoa\node_modules\@vuepress\theme-default\lib\client\styles\_variables.scss 2:9        @import
    node_modules\.pnpm\@vuepress+theme-default@2.0.0-rc.55_markdown-it@14.1.0_sass@1.80.3_vuepress@2.0.0-rc.18_@vuep_w6rbselmw7b23k3zh7mmjp3yoa\node_modules\@vuepress\theme-default\lib\client\styles\_mixins.scss 1:9           @use
    node_modules\.pnpm\@vuepress+theme-default@2.0.0-rc.55_markdown-it@14.1.0_sass@1.80.3_vuepress@2.0.0-rc.18_@vuep_w6rbselmw7b23k3zh7mmjp3yoa\node_modules\@vuepress\theme-default\lib\client\components\VPSidebarItem.vue 2:1  root stylesheet

Warning: 1 repetitive deprecation warnings omitted.
Run in verbose mode to see all warnings.
`
Deprecation Warning: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.```

### Reproduction

pnpm create vuepress vuepress-starter

### Used Package Manager

pnpm

### System Info

```shell
More info and automated migrator: https://sass-lang.com/d/import       

  ╷
2 │ @import '@vuepress/plugin-palette/palette';
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
    node_modules\.pnpm\@vuepress+theme-default@2.0.0-rc.55_markdown-it@14.1.0_sass@1.80.3_vuepress@2.0.0-rc.18_@vuep_w6rbselmw7b23k3zh7mmjp3yoa\node_modules\@vuepress\theme-default\lib\client\styles\_variables.scss 2:9        @import
    node_modules\.pnpm\@vuepress+theme-default@2.0.0-rc.55_markdown-it@14.1.0_sass@1.80.3_vuepress@2.0.0-rc.18_@vuep_w6rbselmw7b23k3zh7mmjp3yoa\node_modules\@vuepress\theme-default\lib\client\styles\_mixins.scss 1:9           @use
    node_modules\.pnpm\@vuepress+theme-default@2.0.0-rc.55_markdown-it@14.1.0_sass@1.80.3_vuepress@2.0.0-rc.18_@vuep_w6rbselmw7b23k3zh7mmjp3yoa\node_modules\@vuepress\theme-default\lib\client\components\VPSidebarItem.vue 2:1  root stylesheet

Warning: 1 repetitive deprecation warnings omitted.
Run in verbose mode to see all warnings.

Deprecation Warning: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.
@phnglh
Copy link

phnglh commented Oct 20, 2024

I have this problem too
Screenshot 2024-10-20 at 17 05 09

@ntnyq
Copy link

ntnyq commented Oct 21, 2024

The warnings can be suppressed by setting in config.ts:

import { viteBundler } from '@vuepress/bundler-vite'
import { defineUserConfig } from 'vuepress'

export default defineUserConfig({
  bundler: viteBundler({
    viteOptions: {
      css: {
        preprocessorOptions: {
          scss: {
            silenceDeprecations: ['import'],
          },
        },
      },
    },
  }),
})

@Mister-Hope Mister-Hope transferred this issue from vuepress/core Oct 21, 2024
@Mister-Hope Mister-Hope linked a pull request Oct 21, 2024 that will close this issue
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.

3 participants