svelte fails to parse valid CSS
See original GitHub issueDescribe the bug svelte css parser fails to consider valid css which include backslash
Logs
from https://github.com/wighawag/a17t-svelte-test :
$ rollup -c
src/main.js → public/build/bundle.js...
[!] (plugin svelte) ParseError: RightParenthesis is expected
src\Tailwindcss.svelte
70535: transition-delay:1000ms
70536: }
70537: }</style>
^
ParseError: RightParenthesis is expected
at error (C:\dev\projects\wighawag\a17t-svelte-test\node_modules\svelte\src\compiler\utils\error.ts:25:16)
at Parser$1.error (C:\dev\projects\wighawag\a17t-svelte-test\node_modules\svelte\src\compiler\parse\index.ts:93:3)
at Object.read_style [as read] (C:\dev\projects\wighawag\a17t-svelte-test\node_modules\svelte\src\compiler\parse\read\style.ts:21:11)
at tag (C:\dev\projects\wighawag\a17t-svelte-test\node_modules\svelte\src\compiler\parse\state\tag.ts:190:27)
at new Parser$1 (C:\dev\projects\wighawag\a17t-svelte-test\node_modules\svelte\src\compiler\parse\index.ts:45:12)
at parse (C:\dev\projects\wighawag\a17t-svelte-test\node_modules\svelte\src\compiler\parse\index.ts:208:17)
at compile (C:\dev\projects\wighawag\a17t-svelte-test\node_modules\svelte\src\compiler\compile\index.ts:79:14)
at C:\dev\projects\wighawag\a17t-svelte-test\node_modules\rollup-plugin-svelte\index.js:252:22
at ModuleLoader.addModuleSource (C:\dev\projects\wighawag\a17t-svelte-test\node_modules\rollup\dist\shared\rollup.js:17742:30)
at ModuleLoader.fetchModule (C:\dev\projects\wighawag\a17t-svelte-test\node_modules\rollup\dist\shared\rollup.js:17796:9)
To Reproduce
git clone https://github.com/wighawag/a17t-svelte-test
cd a17t-svelte-test
yarn && yarn build
Expected behavior
should build succesfully with css from a17t
(https://github.com/milesmcc/a17t)
Stacktraces
see log above
Information about your Svelte project:
-
Your operating system: Windows 10
-
Svelte version : 3.23.2
-
Whether your project uses Webpack or Rollup : Rollup
Severity
It block me from using css library like a17t
so pretty severe in my opinion
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Colon is expected (svelte with scss style) svelte unit testing
ParseError : Colon is expected (svelte with scss style) svelte unit ... But the test is throwing error that it's not able to...
Read more >Getting started with Svelte - Learn web development | MDN
Svelte sticks closely to the classic web development model of HTML, CSS, and JS, just adding a few extensions to HTML and JavaScript....
Read more >Learn How SvelteKit Works As a Framework - Joy of Code
SvelteKit is a full stack framework that gives you the best of both worlds where the page is server-side rendered on your first...
Read more >What's new in Svelte: December 2022
The css compiler options of css: false and css: true have been replaced with ... frustrating post-mortems after a project fails; BLKMARKET.
Read more >Using Custom Elements in Svelte | CSS-Tricks
In either case, if the custom element is not defined, Svelte will set everything as attributes. This is because the property does not...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
svelte@3.41.0 compiler gave me “RightParenthesis is expected” on this css for me just now:
filter: alpha(opacity=65);
.https://svelte.dev/repl/5e7e42fe56af440f8dceaef7160f0c46?version=3.41.0
<style global>
isn’t a native Svelte thing. This probably is a bug in svelte-preprocess.