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

Typescript error TS2380: "get and set accessor must have the same type" on v2.4.3 #692

Closed
sheerlox opened this issue Sep 1, 2023 · 4 comments
Labels
type:bug Bug reports and bug fixes

Comments

@sheerlox
Copy link
Collaborator

sheerlox commented Sep 1, 2023

Hi, after update and clean build I started receiving

node_modules/@types/luxon/src/settings.d.ts:27:16 - error TS2380: 'get' and 'set' accessor must have the same type.

27     static get defaultZone(): Zone;
                  ~~~~~~~~~~~

node_modules/@types/luxon/src/settings.d.ts:28:16 - error TS2380: 'get' and 'set' accessor must have the same type.

28     static set defaultZone(zone: Zone | string);

image

To fix it, I needed to downgrade back to 2.4.0 version. My current TS version is 4.2.3

Originally posted by @SirAndrii in #688 (comment)

@sheerlox
Copy link
Collaborator Author

sheerlox commented Sep 1, 2023

Hey @SirAndrii, I tried reproducing the issue but couldn't get the same error (see sheerlox/node-cron-test).

Please share more information about your setup, especially which other libraries (with versions) you're using on your project.

Have you tried deleting your node_modules and running npm install again? That could maybe solve the issue.

@sheerlox sheerlox removed their assignment Sep 1, 2023
@SirAndrii
Copy link

SirAndrii commented Sep 1, 2023

Hey @SirAndrii, I tried reproducing the issue but couldn't get the same error (see sheerlox/node-cron-test).

Please share more information about your setup, especially which other libraries (with versions) you're using on your project.

Have you tried deleting your node_modules and running npm install again? That could maybe solve the issue.

on our project we use YARN. Before installation, I removed all node_module folders and yarn.lock files, so the installation was clean. And I made a mistake about TS, it's 3.8.3

"dependencies": {
    "body-parser": "^1.19.2",
    "cron": "2.4.0",
    "express": "^4.17.3",
    "fs-extra": "^5.0.0",
    "knex": "^0.21.21",
    "multer": "^1.4.4",
    "moment": "^2.29.4",
    "ws": "^3.3.3"
  },
  "devDependencies": {
    "@types/multer": "^1.4.7",
    "jest": "^22.4.3",
    "typescript": "3.8.3"
  },

@sheerlox
Copy link
Collaborator Author

sheerlox commented Sep 1, 2023

With the packages you shared, I'm getting 147 Typescript errors, none related to cron (and most point to @types/node/ts4.8), whether I'm installing with yarn or npm is the same. I've updated my test repository accordingly if you'd like to take a look.

Since it seems this issue is hard to reproduce, or I am missing some information, could you share a minimal reproduction repository so I can investigate the issue?

But, on the other hand, the issue seems to be related to @types/luxon not being compatible with your Typescript version (which is ~ 4 years old). If you often get this kind of issue it could be interesting to think about upgrading to the latest version of Typescript.

@sheerlox
Copy link
Collaborator Author

sheerlox commented Sep 7, 2023

Hello @SirAndrii, any update on this? Closing for now since I can't reproduce this bug, feel free to reopen if you can provide more information.

@sheerlox sheerlox closed this as not planned Won't fix, can't repro, duplicate, stale Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Bug reports and bug fixes
Projects
None yet
Development

No branches or pull requests

2 participants