question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Property descriptions missing from Docs Page on Svelte + TypeScript

See original GitHub issue

Describe the bug When a Svelte component is using plain JavaScript, its property descriptions are extracted from JSDoc blocks inside the component. However, if you switch <script> with <script lang="ts"> (and optionally adding some types in there), it stops picking up anything at all.

To Reproduce https://github.com/notpushkin/repro-storybook-svelte-typescript

git clone https://github.com/notpushkin/repro-storybook-svelte-typescript.git
cd repro-storybook-svelte-typescript
yarn
yarn storybook

System

Environment Info:

  System:
    OS: Linux 5.4 Ubuntu 20.04.2 LTS (Focal Fossa)
    CPU: (4) x64 Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz
  Binaries:
    Node: 14.17.5 - /usr/bin/node
    Yarn: 1.22.5 - /usr/bin/yarn
    npm: 6.14.14 - /usr/bin/npm
  Browsers:
    Firefox: 91.0
  npmPackages:
    @storybook/addon-actions: ^6.4.0-alpha.30 => 6.4.0-alpha.30 
    @storybook/addon-essentials: ^6.4.0-alpha.30 => 6.4.0-alpha.30 
    @storybook/addon-links: ^6.4.0-alpha.30 => 6.4.0-alpha.30 
    @storybook/addon-svelte-csf: ^1.1.0 => 1.1.0 
    @storybook/svelte: ^6.4.0-alpha.30 => 6.4.0-alpha.30 

Additional context Possibly related? #14876

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
pmalacho-mitcommented, Mar 18, 2022

Hello! Has anyone had the chance to look into this? I’m using 6.5.0-alpha.49 and no js doc info is pulled when my script tag is marked as lang=ts (regardless of if the variable has a type declaration).

It definitely is my preference to be able to use typescript as expected and have my js doc comments pulled into the storybook UI. The automatic documentation is such a cool feature! Definitely unfortunate to have to choose between it and using typescript in svelte components.

2reactions
IanVScommented, Jun 2, 2022

You can track https://github.com/alexprey/sveltedoc-parser/issues/34 for typescript support in the package we use to extract docs information from svelte files.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Docs • Svelte
This page contains detailed API reference documentation. ... Readonly props can be accessed as properties on the element, tied to the component using ......
Read more >
19 - Stack Overflow
when I run the rollup script to compile svelte app, i am getting cannot find module ./App.svelte error as shown below. Plugin typescript:...
Read more >
Building Svelte Society: Svelte and TypeScript with Simon H
TypeScript in Svelte can be a bit of a mystery. Especially if you don't know TypeScript. Today I'm getting some expert help from...
Read more >
TypeScript support in Svelte - Learn web development
First add the lang="ts" to our <script> tag. Let's import the type and use it to declare the todo property. Replace the export...
Read more >
TSConfig Reference - Docs on every TSConfig option
A TSConfig file in a directory indicates that the directory is the root of a TypeScript or JavaScript project... Compiler Options. Top Level....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found