-
Notifications
You must be signed in to change notification settings - Fork 97
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
Error: unknown node type: Script #456
Comments
Just had this issue, refer to the documentselectors setting in the readme and it works after. this is a regression, however, and this is a workaround not a solution |
I could be wrong, but documentselectors looks to be VSCode-spcific. Forgot to mention that I'm not using VSCode but WebStorm. |
Yeah i just worked around it I’m not sure where the equivalent prettierrc
setting is
…On Tue, 6 Aug 2024 at 9:41 AM Hrishikesh Kokate ***@***.***> wrote:
I could be wrong, but documentselectors looks to be VSCode-spcific. Forgot
to mention that I'm not using VSCode but WebStorm.
—
Reply to this email directly, view it on GitHub
<#456 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACFY5BLLZQS7QHSOX4NKEW3ZQBV27AVCNFSM6AAAAABL664XKGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZQGUYDANZQGI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Not sure what’s wrong it stopped working now, 3.2.5 works fine
…On Tue, 6 Aug 2024 at 9:41 AM Hrishikesh Kokate ***@***.***> wrote:
I could be wrong, but documentselectors looks to be VSCode-spcific. Forgot
to mention that I'm not using VSCode but WebStorm.
—
Reply to this email directly, view it on GitHub
<#456 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACFY5BLLZQS7QHSOX4NKEW3ZQBV27AVCNFSM6AAAAABL664XKGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZQGUYDANZQGI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I tried downgrading to 3.0.3, but it's still broken for me. |
This has something to do with |
Pretty sure it's coming from this plugin itself, at least in my case. I tried to comment out the Tailwind plugin stuff, but I continue to get the same issue. |
I'm also encountering this issue. I'm working on adding support for svelte files to biome's playground: biomejs/website#1010. I've tracked down where this is being thrown from: prettier-plugin-svelte/src/print/index.ts Line 736 in 5630294
|
@hrishikesh-k can you do a branch on your repo to show how you have commented it out and still get the error? Because I did also use your repo and the error went away after removing the tailwind plugin. |
I've updated all the deps and pushed the changes to With that being said, I'm likely moving off to biome instead of dealing with eslint + prettier. Svelte is not completely supported there yet, but that's bearable for now (the script gets correctly linted which is good enoug for me). So at this point, I'm no longer blocked by this issue. |
Same here out of the blue prettier error2024-10-25 18:48:26[ERROR] Formatter 'prettier' error: {
"type": "Script",
"start": 0,
"end": 71,
"context": "default",
"content": {
"type": "Program",
"start": 60,
"end": 62,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 62
}
},
"body": [
{
"type": "BlockStatement",
"start": 60,
"end": 62,
"loc": {
"start": {
"line": 1,
"column": 60
},
"end": {
"line": 1,
"column": 62
}
},
"body": []
}
],
"sourceType": "module"
}
}
[error] src/routes/ease/+page.svelte: Error: unknown node type: Script
[error] at Object.print (/Users/melmassadian/dev/melmass/mtb/node_modules/prettier-plugin-svelte/plugin.js:1474:11)
[error] at callPluginPrintFunction (/Users/melmassadian/dev/melmass/mtb/node_modules/prettier/index.js:8601:26)
[error] at mainPrintInternal (/Users/melmassadian/dev/melmass/mtb/node_modules/prettier/index.js:8550:22)
[error] at mainPrint (/Users/melmassadian/dev/melmass/mtb/node_modules/prettier/index.js:8537:18)
[error] at AstPath.call (/Users/melmassadian/dev/melmass/mtb/node_modules/prettier/index.js:8359:24)
[error] at printTopLevelParts (/Users/melmassadian/dev/melmass/mtb/node_modules/prettier-plugin-svelte/plugin.js:1515:33)
[error] at Object.print (/Users/melmassadian/dev/melmass/mtb/node_modules/prettier-plugin-svelte/plugin.js:929:16)
[error] at callPluginPrintFunction (/Users/melmassadian/dev/melmass/mtb/node_modules/prettier/index.js:8601:26)
[error] at mainPrintInternal (/Users/melmassadian/dev/melmass/mtb/node_modules/prettier/index.js:8550:22)
[error] at mainPrint (/Users/melmassadian/dev/melmass/mtb/node_modules/prettier/index.js:8537:18)
|
Found the issue by checking the lockfile, I had a dep installing an old version of prettier ( |
I was facing the same issue. Check if your prettier config has.
Enabling it fixed the issue. |
Trying to add Prettier to my project: https://github.com/hrishikesh-k/blog. Running
npx prettier . --write
fails with the above error. Here's the entire output:Terminal output
I'm using Node.js 20 in Ubuntu 24.04 (WSL).
The text was updated successfully, but these errors were encountered: