SASS Compile error when kendo scss files are imported in stylesheet

2 Answers 772 Views
General Discussions
SysCo
Top achievements
Rank 1
Iron
Iron
SysCo asked on 19 Jan 2023, 02:45 PM

Hello,

I've an error regarding Kendo style when I import it into an SCSS file. Let's assume I want to customize Kendo theme, I have 4 scss files :

  • _tokens.scss which contains color palette definition
  • the kendo scss theme (kendo-theme-bootstrap in this case, but same issue with the default theme)
  • _overrides.scss which may contains overrides (typhography, margin/padding on some components, etc)
  • and a base.scss file containing basically the import of the 3 preceding files :
@import 'tokens';
@import '@progress/kendo-theme-bootstrap/dist/all';
@import 'overrides';

However, when I import my base.scss file into the Vue App (whether in the main.js or the App.vue), I've this error :

Plugin: vite:css
  File: /src/node_modules/@progress/kendo-theme-bootstrap/dist/all.scss:37542:173
  Error: expected ";".
        ╷
  37542 │             background-image: url('../../node_modules/@progress/kendo-theme-bootstrap/dist/k-map-get($_kendo-data-uris, $kendo-spreadsheet-insert-image-dialog-preview-img'));
        │                                                                                                                                                                             ^
        ╵
    node_modules/@progress/kendo-theme-bootstrap/dist/all.scss 37542:173  @import
    src/assets/kendo.scss 2:9                                             @import
    src/assets/base.scss 1:9                                              root stylesheet

If I import directly the kendo-theme-bootstrap scss file in the main.js or the App.vue, there is no error. Here is the StackBlitz reproducing the error:

https://stackblitz.com/edit/vitejs-vite-f63fqh

How can I resolve this ?

Best Regards,

Fabien / SYSCO

SysCo
Top achievements
Rank 1
Iron
Iron
commented on 25 Jan 2023, 09:53 AM

Hello Ivan,

Yes, it is working with the file with interpolation !

Tony
Top achievements
Rank 1
commented on 27 Jan 2023, 10:38 PM

Hi Ivan,

We're running into this same issue with KendoReact using Vite. Will you be distributing updated theme scss files with interpolation for that line?

Ivan Zhekov
Telerik team
commented on 30 Jan 2023, 04:39 PM

Our scheduled release i still weeks away, which I believe would be a major show stopper for Vue / Vite developers. We'll make a release of the themes this week and I will notify you here.
Tony
Top achievements
Rank 1
commented on 30 Jan 2023, 04:43 PM

Thank you!
Ivan Zhekov
Telerik team
commented on 01 Feb 2023, 08:08 AM

Here is the PR: https://github.com/telerik/kendo-themes/pull/4256

We'll merge it and release a new version of the themes.

2 Answers, 1 is accepted

Sort by
0
Accepted
Ivan Zhekov
Telerik team
answered on 03 Feb 2023, 01:19 PM

v6.1.0 released!

Regards,
Ivan Zhekov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tony
Top achievements
Rank 1
commented on 03 Feb 2023, 02:58 PM

That's great news! Thanks!
SysCo
Top achievements
Rank 1
Iron
Iron
commented on 07 Feb 2023, 09:29 AM

Great, it's working. Thank you !
0
Ivan Zhekov
Telerik team
answered on 23 Jan 2023, 11:49 AM | edited on 30 Jan 2023, 04:38 PM

Hello, Fabien.

The issue is related to vite trying to be too helpful -- originally, there is a valid function call at that place in the code:

However, vite reading trough the file, decides that it's an URL and decides to provide relative path to node modules. Hence, making the function signature invalid.

If we use interpolation, and that's just speculation, perhaps vite's heuristics will recognize it as something else and could wait for the css to be produced and then provide the paths.

I am attaching the same file, but will interpolation. Can you verify that it works correctly on your end?

Update:

we'll have a theme released because it's a critical problem for vue / vite developers.

SysCo
Top achievements
Rank 1
Iron
Iron
commented on 31 Jan 2023, 12:32 PM

Awesome ! Thank you !
Tags
General Discussions
Asked by
SysCo
Top achievements
Rank 1
Iron
Iron
Answers by
Ivan Zhekov
Telerik team
Share this question
or