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.

[v4] comlink.d.ts(14,26): error TS2307: Cannot find module './protocol.js'.

See original GitHub issue

Version 4.0.0-alpha.7

dist/umd/comlink.d.ts in the published package is broken. It imports './protocol.js' but protocol.js doesn’t exist.

https://unpkg.com/comlink@4.0.0-alpha.7/dist/umd/comlink.d.ts

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
surmacommented, Mar 21, 2019

Yeah, this is a long-standing issue with TypeScript, but this problem already existed with Comlink v3.

FWIW, whenever you use bundlers like Rollup you don’t get these errors.

casting as any is the only solution in this case…

Not true 😄 That is the reason why I set self to be the default value for expose(), so this will compile just fine:

expose(Markdown);

0reactions
lacolacocommented, Mar 21, 2019

@surma I didn’t know about the default value! It’s perfect for me. Thank you!

The original issue is solved. I close here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

tsc throws `TS2307: Cannot find module` for a local file
ts (5,20): error TS2307: Cannot find module 'components/button'. It complains about all imports of local files, like the following: import Counter from ' ......
Read more >
Documentation - Module Resolution - TypeScript
How TypeScript resolves modules in JavaScript. ... In this case, the error would be something like error TS2307: Cannot find module 'moduleA'.
Read more >
error ts2307: cannot find module or its corresponding type ...
The error TS2307: Cannot find module or its corresponding type declarations generally occurs when you try to import a module or library that...
Read more >
How to fix error TS7016: Could not find a declaration file for ...
Try `npm install @types/XYZ` if it exists or add a new declaration (.d. · declare module 'XYZ';. Lastly, you also need to add...
Read more >
ts-loader - npm
Code Splitting and Loading Other Resources; Declarations (.d.ts); Failing the build on TypeScript compilation error; baseUrl / paths module ...
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