8000 The project packaging will report this TypeScript error. · Issue #4006 · vueuse/vueuse · GitHub
[go: up one dir, main page]

Skip to content

The project packaging will report this TypeScript error. #4006

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

Closed
7 tasks done
xstxhjh opened this issue May 30, 2024 · 7 comments · Fixed by #4028
Closed
7 tasks done

The project packaging will report this TypeScript error. #4006

xstxhjh opened this issue May 30, 2024 · 7 comments · Fixed by #4028

Comments

@xstxhjh
Copy link
xstxhjh commented May 30, 2024

Describe the bug

node_modules/@vueuse/shared/index.d.ts:398:119 - error TS1128: Declaration or statement expected.

398 declare function makeDestructurable<T extends Record<string, unknown>, const A extends readonly any[]>(obj: T, arr: A): T & A;
~
Found 10 errors in the same file, starting at: node_modules/@vueuse/shared/index.d.ts:398

Reproduction

new version

System Info

System:
    OS: macOS 14.2.1
    CPU: (11) arm64 Apple M3 Pro
    Memory: 96.42 MB / 18.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.19.0 - ~/.nvm/versions/node/v18.19.0/bin/node
    Yarn: 1.22.21 - ~/.nvm/versions/node/v18.19.0/bin/yarn
    npm: 10.2.3 - ~/.nvm/versions/node/v18.19.0/bin/npm
    pnpm: 8.15.4 - ~/.nvm/versions/node/v18.19.0/bin/pnpm
    bun: 1.1.6 - ~/.bun/bin/bun
  Browsers:
    Chrome: 125.0.6422.113
    Safari: 17.2.1
  npmPackages:
    @vueuse/core: ^10.10.0 => 10.10.0 
    vue: ^3.4.27 => 3.4.27

Used Package Manager

npm

Validations

@xstxhjh
Copy link
Author
xstxhjh commented May 30, 2024

I downgraded to version 10.9.0 and there would be no such error.

@oliver139
Copy link

Same here, got the same error while deploying to production yesterday
I downgraded to 10.9.0 to resolve the error

{
  "dependencies": {
    "@vueuse/core": "~10.9.0",
  }
}

@brenoepics
Copy link
Contributor

After some research, I discovered that the issue occurs when you run VueUse 10.10.0 with TypeScript versions below 5. This commit broke support for TypeScript versions below 5 because const modifier on type parameters was added in TypeScript 5.

It wasn't a problem for me to update the TypeScript version. However, I'm not sure about @xstxhjh, @oliver139, and others. If it's an issue for them, a maintainer could consider reverting this commit.

@oliver139
Copy link

After some research, I discovered that the issue occurs when you run VueUse 10.10.0 with TypeScript versions below 5. This commit broke support for TypeScript versions below 5 because const modifier on type parameters was added in TypeScript 5.

It wasn't a problem for me to update the TypeScript version. However, I'm not sure about @xstxhjh, @oliver139, and others. If it's an issue for them, a maintainer could consider reverting this commit.

Ok, I see. I am having TS ~4.5.5 here and would see if I am able to upgrade the TS version.

Thanks anyway!

@drahkrub
Copy link
drahkrub commented Jun 3, 2024

..., a maintainer could consider reverting this commit.

Would be nice if this happens, because our projects depend on https://quasar.dev/ which does not support Typescript >= 5 right now.

@Bassadin
Copy link
Bassadin commented Jun 5, 2024

I think it should at least be marked as a potential breaking change, not supporting TS<5 anymore :D

@oliver139
Copy link

I think it should at least be marked as a potential breaking change, not supporting TS<5 anymore :D

Agree. Where minor version change should be backward compatible I think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
0