Skip to content

Getting typing error with ClsStore interface #20

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
ruslanguns opened this issue Feb 26, 2022 · 5 comments
Closed

Getting typing error with ClsStore interface #20

ruslanguns opened this issue Feb 26, 2022 · 5 comments
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@ruslanguns
Copy link

I am getting the following typing error when trying to use the package.

node_modules/nestjs-cls/dist/src/lib/cls.interfaces.d.ts:42:6 - error TS1023: An index signature parameter type must be either 'string' or 'number'.

42     [key: symbol]: any;
        ~~~

Reproduction repository: https://github.com/ruslanguns/cqrs-with-cls

System information

[System Information]
OS Version     : Linux 5.10
NodeJS Version : v16.13.1
NPM Version    : 8.3.0 

[Nest CLI]
Nest CLI Version : 8.0.2 

[Nest Platform Information]
platform-express version : 8.0.0
common version           : 8.0.0
core version             : 8.0.0
cqrs version             : 8.0.0
@joebowbeer
Copy link
Contributor

TypeScript version?

This was implemented in microsoft/TypeScript#44512 which I think was released in 4.4.

@ruslanguns
Copy link
Author

ruslanguns commented Feb 27, 2022

Morning FYI @joebowbeer I have created two different tests:

  1. Using version rolling back cls to v1.6.2 and works smoothly: https://github.com/ruslanguns/cqrs-with-cls/tree/Using-CLS-1.6.2

  2. Rolling back typescript to v4.4 and works smootly: https://github.com/ruslanguns/cqrs-with-cls/tree/RollbackTypeScript-4.4

EDITION: I was meaning Rolling up, instead of back!!!

ruslanguns added a commit to ruslanguns/nestjs-cls that referenced this issue Feb 27, 2022
This commit is going to close the Papooch#20.
@Papooch Papooch added the bug Something isn't working label Feb 27, 2022
@Papooch
Copy link
Owner

Papooch commented Feb 27, 2022

@ruslanguns regarding 2)
Didn't you mean upgrading to typescript 4.4? I remember you saying it didn't work on 4.3. That would mean this is actually a non-issue and it's only needed to add the minimum version requirement to the readme.
However, if your PR fixes it for lower versions as well, I'll be more than happy to merge it

@ruslanguns
Copy link
Author

Thanks for clarifying and yes, sorry for my mistake I was meaning rolling up... definitely the problem happens in versions before v4.4 like v4.3.5 which I was... the change with Record allows me to work with v4.3.5 smoothly

@Papooch Papooch added the wontfix This will not be worked on label Feb 27, 2022
@Papooch Papooch closed this as completed Feb 27, 2022
@Papooch
Copy link
Owner

Papooch commented Feb 27, 2022

Works as intended with typescript >= 4.4. See the linked PR for more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants