Error "Cannot find module 'tweetnacl'" with TypeScript compilation
See original GitHub issueDo you want to request a feature or report a bug?
I want to report a bug when using it with TypeScript.
What is the current behavior?
I cannot build a module with pusher-js v6.0.0 on this repository. The error message “Cannot find module ‘tweetnacl’” will appear when using tsc
.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar.
Clone this repository, and run npm run tsc
. you can get the following output:
> test-pusher@0.1.0 tsc /tmp/test-pusher
> tsc
node_modules/pusher-js/types/src/core/config.d.ts:3:23 - error TS2307: Cannot find module 'tweetnacl'.
3 import * as nacl from 'tweetnacl';
~~~~~~~~~~~
node_modules/pusher-js/types/src/core/options.d.ts:3:23 - error TS2307: Cannot find module 'tweetnacl'.
3 import * as nacl from 'tweetnacl';
~~~~~~~~~~~
Found 2 errors.
What is the expected behavior?
The TypeScript compilation should succeed.
Which versions of Pusher, and which browsers / OS are affected by this issue? Did this work in previous versions of Pusher? If so, which?
- Pusher version: 6.0.0
- Browser: None (This occurs at compilation)
- OS: Arch Linux
- The previous version 5.1.1 worked well
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
tweetnacl - npm
Start using tweetnacl in your project by running `npm i tweetnacl`. ... TypeScript icon, indicating that this package has built-in type ...
Read more >How do I resolve "Cannot find module" error using Node.js?
The command will import the NodeJS TypeScript definitions into your project, allowing you to use Node's built-in modules. Share.
Read more >error ts2307: cannot find module 'fs' or its corresponding type ...
Describe the bug When compiling a workspace, typescript seems not to be able to find type definitions (i.e. @types/…) that are dependencies of...
Read more >/CHANGELOG.tweetnacl-js.md | tweetnacl_deno@v1.0.3 | Deno
Port of TweetNaCl cryptographic library to TypeScript for Deno. ... it will no longer work and will not detect failure. Please check your...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@yykamei thanks for highlighting this. I’ve been able to reproduce it.
I just pushed a new release v6.0.1. @yykamei I’d be interested to hear whether this solves your problem