milesmcc/a17t

ParseError: RightParenthesis is expected

wighawag opened this issue · 3 comments

Getting this error

it might be related to #5 and how svelte process css somehow, but maybe not ?

Interestingly (which is the issue I encounter in #5) if I import a17t after tailwind directive (see https://github.com/wighawag/a17t-svelte-test) none of a17t css get included and I do not get the error

$ rollup -c -w
rollup v2.18.0
bundles 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)

This repo : https://github.com/wighawag/a17t-svelte-test reproduce the issue

The reason it doesn't get imported if you put the import after Tailwind is that @imports must be the first thing in the file.

a17t exports its CSS like any other CSS library, so this looks to me like some kind of misconfiguration in that repository with postcss-import. Feel free to reopen if you're convinced this is an a17t error.

Until then, though,I'm going to need to close this issue. I really can't help here -- I have never worked with Svelte and Rollup in-depth, so there's not much I can do. Maybe StackOverflow could help?

After investigating further this seems indeed to be an issue with svelte itself : sveltejs/svelte#5078

Got it. Let me know if you reach a resolution — I’d hate for Svelte users to be prevented from using a17t!