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

If parsedAsCustomProperty is true, value must contain a SassString #2023

Closed
sysmat opened this issue Jun 20, 2023 · 5 comments · Fixed by #2036
Closed

If parsedAsCustomProperty is true, value must contain a SassString #2023

sysmat opened this issue Jun 20, 2023 · 5 comments · Fixed by #2036
Assignees
Labels

Comments

@sysmat
Copy link

sysmat commented Jun 20, 2023

  • When using "@picocss/pico": "^1.5.10" sass I get error
  • "sass": "^1.63.4", it works with previous version
$primary-500: #E65A00;
$primary-600: #C54100;
$primary-700: #A52D00;

// Import full Pico source code
@import "./node_modules/@picocss/pico/scss/pico.scss";
  • error
Unexpected exception:
Invalid argument(s): If parsedAsCustomProperty is true, value must contain a SassString (was `"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"` of type SassList).


node_modules\sass\sass.dart.js 1267:17   Object.wrapException
node_modules\sass\sass.dart.js 1281:15   Object.throwExpression
node_modules\sass\sass.dart.js 7919:15   Object.ModifiableCssDeclaration$
node_modules\sass\sass.dart.js 64390:70  _EvaluateVisitor.visitCssDeclaration$1
node_modules\sass\sass.dart.js 37073:22  ModifiableCssDeclaration.accept$1$1
node_modules\sass\sass.dart.js 37076:19  ModifiableCssDeclaration.accept$1
node_modules\sass\sass.dart.js 66207:40  _EvaluateVisitor_visitCssStyleRule__closure.call$0
node_modules\sass\sass.dart.js 64606:25  _EvaluateVisitor._withStyleRule$1$2
node_modules\sass\sass.dart.js 64611:19  _EvaluateVisitor._withStyleRule$2
node_modules\sass\sass.dart.js 66198:10  _EvaluateVisitor_visitCssStyleRule_closure.call$0
@Goodwine
Copy link
Member

I'm unable to repro with the provided info. Can you provide a small repro repository and instructions on how to reproduce this?

What I tried:

cd $(mktemp --dir)
npm init # accept everything as default
npm install sass @picocss/pico ts-node

Setup my package.json scripts to:

"scripts": {
  "test": "ts-node index.ts",
  "sass": "sass index.scss"
}

I used your input as index.scss and created an index.ts file with:

import * as sass from "sass";
const css = sass.compile("./index.scss");
console.log(css.css);

Then ran:

npm run test # compiles with JS API
npm run sass # compiles with CLI

Both of those commands compiled everything without any issue.
FWIW - I used a linux machine. I tried both Sass versions: 1.63.4 and 1.63.6.

@sysmat
Copy link
Author

sysmat commented Jun 28, 2023

  • my mistake wrong version of pico "@picocss/pico": "2.0.0-alpha1"

@Goodwine
Copy link
Member

Thanks, I can repro with this

@Goodwine
Copy link
Member

Minimal repro:

<===> main.scss
@import 'foo';

<===> foo.scss
@use 'bar';

<===> bar.scss
a { #{--}: b c }

Basically #{--}: seems to mess things up.. but it only happens when @importing a file that @uses another file...

@Goodwine
Copy link
Member

It seems like the reason is that the @use will "process" the downstream files so #{--} (or #{--foo} will become plain --. Then this crashes 🤔

Goodwine added a commit to sass/sass-spec that referenced this issue Jul 12, 2023
Goodwine added a commit to sass/sass-spec that referenced this issue Jul 14, 2023
* Add regression test for sass/dart-sass#2023

* ignore for libsas because of @use
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants