Skip to content
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

Parent types break with incomplete JSDoc Comment in TS file #6834

Closed
RSWilli opened this issue Sep 15, 2022 · 0 comments · Fixed by #6884
Closed

Parent types break with incomplete JSDoc Comment in TS file #6834

RSWilli opened this issue Sep 15, 2022 · 0 comments · Fixed by #6884
Labels
bug Something isn't working types / typescript

Comments

@RSWilli
Copy link

RSWilli commented Sep 15, 2022

Describe the bug

My parent types are not getting inferred, if I add a comment on top of the load function in my +layout.ts, that does not have any @type info

Reproduction

The comment above the load breaks the parent types

/**
 * instantiate the APIs for use in the other routes
 */
export const load: LayoutLoad = async ({ fetch }) => {
//...
}

The following works fine (not a JSDoc comment, /* instead of /**):

/*
 * instantiate the APIs for use in the other routes
 */
export const load: LayoutLoad = async ({ fetch }) => {
//...
}

it looks like such an "invalid" JSDoc comment can be anywhere in the file and destroy the type generation

Logs

no logs given

System Info

System:
    OS: Linux 5.15 Arch Linux
    CPU: (8) x64 Intel(R) Core(TM) i5-8350U CPU @ 1.70GHz
    Memory: 21.13 GB / 31.22 GB
    Container: Yes
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.3.0 - ~/.nvm/versions/node/v18.3.0/bin/node
    Yarn: 1.22.19 - /usr/bin/yarn
    npm: 8.11.0 - ~/.nvm/versions/node/v18.3.0/bin/npm
  Browsers:
    Chromium: 105.0.5195.125
    Firefox: 104.0.2

Severity

annoyance

Additional Information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working types / typescript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants