Error: unknown type: "TSJSDocNullableType"
See original GitHub issueI’ve got this error using babel 7 and typescript files
Error: unknown type: "TSJSDocNullableType"
at printPathNoParens (node_modules/prettier/bin-prettier.js:21788:13)
[error] at Object.genericPrint$1 [as print] (node_modules/prettier/bin-prettier.js:19544:28)
[error] at genericPrint (node_modules/prettier/bin-prettier.js:10130:18)
[error] at node_modules/prettier/bin-prettier.js:10076:16
[error] at Object.printComments (node_modules/prettier/bin-prettier.js:9838:17)
[error] at printGenerically (node_modules/prettier/bin-prettier.js:10075:22)
[error] at node_modules/prettier/bin-prettier.js:23606:34
[error] at FastPath.each (node_modules/prettier/bin-prettier.js:9977:7)
[error] at printArrayItems (node_modules/prettier/bin-prettier.js:23604:11)
[error] at printPathNoParens (node_modules/prettier/bin-prettier.js:21065:70)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:15 (9 by maintainers)
Top Results From Across the Web
Prettier 2.0 “2020”
Prettier has been trying not to corrupt these JSDoc type assertions ... 1.19 Error: unknown type: "TSJSDocNullableType" // Prettier 2.0 ...
Read more >The unknown Type in TypeScript
TypeScript 3.0 introduced a new unknown type which is the type-safe counterpart of the any type.
Read more >pretter下载之后使用报错了 - DCloud问答
... 10:59:34.916 throw new Error("unknown type: " + JSON.stringify(n.type)); ... [Format] 10:59:34.916 Error: unknown type: "TSJSDocNullableType" [Format] ...
Read more >The unknown type in TypeScript
Anything is assignable to unknown , but unknown is not assignable to anything but itself and any without a type assertion or a...
Read more >What is the "unknown" Type in TypeScript?
In TypeScript, any value can be assigned to the "unknown" type, but without a ... const val6: Record<string, any> = val; // Will...
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 FreeTop 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
Top GitHub Comments
@jonnyarnold @itrew TSOptionalType is supported since 1.14 (#4757), I guess you forgot to update?
(TSOptionalType ->
string?
in tuple, TSJSDocNullableType ->?string
)Hello 😃 I stumbled upon this in my own investigation of this error, and can shed a little more light on this.
Typescript 3.0 brought with it optional tuple types, so I can declare a type like:
It looks like prettier (and Typescript’s own compiler, before v3.0) considers the
?
as JSDoc that should be in a comment. However, it’s now valid Typescript.