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.

Cannot find module 'diagnostic-channel'

See original GitHub issue

I am trying to add application insights to my node/express app. I have applicationinsights v0.20.0 installed and now I am getting this error and my app will not run. I do see the ‘diagnostic-channel’ folder in that directory so I am not sure why it says it cannot locate it. On previous projects, I did not have this ‘diagnostic-channel’ when using app insights. Any thoughts?

Application has thrown an uncaught exception and is terminated:
Error: Cannot find module 'diagnostic-channel'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (D:\home\site\wwwroot\node_modules\applicationinsights\out\AutoCollection\CorrelationContextManager.js:4:28)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:25 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
lbochenekcommented, Jan 24, 2018

Hi @OsvaldoRosado @AlexBulankou I just encountered this issue with Node v6.9.4, npm v3.10.10, and applicationinsights v1.0.1. My app is running locally, so it can’t be a permissions/deploy problem.

This is the error message:

./~/diagnostic-channel/dist/src/channel.js
Module not found: Can't resolve 'module' in 'C:\<path>\node_modules\diagnostic-channel\dist\src'

This is my npm node module structure:

+-- applicationinsights@1.0.1
| +-- diagnostic-channel@0.2.0
| +-- diagnostic-channel-publishers@0.2.1
| ` -- zone.js@0.7.6

The node_modules\diagnostic-channel\package.json file is readable, and node_modules\diagnostic-channel\dist\channel.js exists.

Any ideas?

UPDATE: Quickly figured out I was using wrong module, should have been using applicationinsights-js for client-side app insights. Making this note for anyone who stumbles across this issue. Thanks!

1reaction
OsvaldoRosadocommented, Aug 9, 2017

@MSLaguana the .dist folder seems to be fairly unreliably deployed given the history of this bug. What do you think of renaming it to no longer being a dot-folder?

Read more comments on GitHub >

github_iconTop Results From Across the Web

diagnostic-channel - npm
Provides a context-saving pub/sub channel to connect diagnostic event publishers and subscribers. Latest version: 1.1.0, last published: a ...
Read more >
Firebase functions Error: Cannot find module 'diagnostics'
I recently (couple weeks ago) updated my functions directory from Node 8 to Node 10, not sure if that is related to this...
Read more >
Diagnostics Channel | Node.js v19.3.0 Documentation
The node:diagnostics_channel module provides an API to create named channels to report arbitrary message data for diagnostics purposes.
Read more >
cannot find module [Node npm Error Solved] - freeCodeCamp
When you get the “cannot find module” error, or “module not found”, it means you've not installed the package you're trying to use....
Read more >
How to solve "Error: Cannot find module '*.js'" with Node.js
then you are most likely trying to run the wrong file. It is possible you are missing a dependency that is needed from...
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