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

ng-particles: Cannot find module 'tsparticles' or its corresponding type declarations. #1683

Closed
3 of 4 tasks
j0nm1 opened this issue Jun 22, 2021 · 6 comments · Fixed by #1676 or #1719
Closed
3 of 4 tasks

ng-particles: Cannot find module 'tsparticles' or its corresponding type declarations. #1683

j0nm1 opened this issue Jun 22, 2021 · 6 comments · Fixed by #1676 or #1719

Comments

@j0nm1
Copy link

j0nm1 commented Jun 22, 2021

Which version are you using?

ng-particles: 2.12.2
tsparticles: 1.29.2

Is the latest version affected?

  • Yes
  • No

Which library are you using?

  • Vanilla JS (tsparticles)
  • Angular (ng-particles)

Describe the bug

The problem exists when compiling an Angular application that uses ng-particles and tsparticles without "skipLibCheck": true in the tsconfig.json.

The error is:

Error: node_modules/ng-particles/lib/ng-particles.component.d.ts:2:38 - error TS2307: Cannot find module 'tsparticles' or its corresponding type declarations.

2 import type { Container, Main } from 'tsparticles';
                                       ~~~~~~~~~~~~~


Error: node_modules/ng-particles/lib/ng-particles.module.d.ts:1:37 - error TS2307: Cannot find module 'tsparticles' or its corresponding type declarations.

1 import type { ISourceOptions } from 'tsparticles';
                                      ~~~~~~~~~~~~~


Error: node_modules/ng-particles/lib/ng-particles.module.d.ts:9:15 - error TS2307: Cannot find module 'tsparticles' or its corresponding type declarations.

9 export * from 'tsparticles';
                ~~~~~~~~~~~~~

With ng-particles: 2.12.2 and tsparticles: 1.27.0 the problem does not exist, but I would like to update my application to the newest version. Furthermore setting "skipLibCheck": true in the tsconfig.json does solve it as well (but I don't think this is a good solution). Maybe it's related to #1472?

@xscode-auto-reply
Copy link

Thanks for opening a new issue. The team has been notified and will review it as soon as possible.

For urgent issues and priority support, visit https://xscode.com/matteobruni/tsparticles

@matteobruni
Copy link
Collaborator

Hi @j0nm1,

The other issue was fixed, it was an error in the react component type definition.

What is your TypeScript version? I had some issues with TypeScript <=4.0 and I’m working on a fix that will be out soon (I don’t know how soon yet)

@j0nm1
Copy link
Author

j0nm1 commented Jun 22, 2021

Hi, thanks for the quick reply. I'm using typescript: 4.0.8

@matteobruni
Copy link
Collaborator

Ok that’s the issue, there are broken types definitions for TypeScript <4.1, you can try with 1.29.0, this version should work, the 1.29.2 has some changes that didn’t work as expected

@j0nm1
Copy link
Author

j0nm1 commented Jun 22, 2021

Downgrading to version 1.29.0 did not work. But after updating typescript to 4.1.6 it works with 1.29.2.
For me, the problem is resolved with this solution. Thank you!

@matteobruni
Copy link
Collaborator

Thank you @j0nm1 for the test, I’ll investigate more about that before releasing an update

matteobruni added a commit that referenced this issue Jun 22, 2021
fix: fixed #1682
breaking changes: imports with tsparticles/dist must be renamed to tsparticles
@matteobruni matteobruni mentioned this issue Jun 28, 2021
@matteobruni matteobruni linked a pull request Jun 28, 2021 that will close this issue
@matteobruni matteobruni mentioned this issue Jun 28, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants