question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error "Cannot find module 'tweetnacl'" with TypeScript compilation

See original GitHub issue

Do 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:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
leesiocommented, Apr 28, 2020

@yykamei thanks for highlighting this. I’ve been able to reproduce it.

1reaction
leesiocommented, Apr 30, 2020

I just pushed a new release v6.0.1. @yykamei I’d be interested to hear whether this solves your problem

Read more comments on GitHub >

github_iconTop 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 >
tweetnacl | Yarn - Package Manager
Fast, reliable, and secure dependency management.
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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found