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 use it on ReactJs ,

See original GitHub issue

# creating a simple winston variable and calling the log function from it shows the errors bellow

ERROR in ./~/winston/lib/winston/common.js
Module not found: Error: Cannot resolve module 'fs' in
ERROR in ./~/pkginfo/lib/pkginfo.js
Module not found: Error: Cannot resolve module 'fs' in <filepath>
ERROR in ./~/winston/lib/winston/transports/file.js
Module not found: Error: Cannot resolve module 'fs' in

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
shawnxusycommented, Dec 16, 2016

@bradisbell I’d guess you are importing the winston in a browser environment, which winston is not supporting right now (see #582). Even if you think your winston is imported in a server-only file (let’s say logger.js), make sure to check that logger.js is not imported into another file used by webpack browser build. It is common that this happens with universal rendering. In short, winston stays in Node only.

1reaction
danieleleonicommented, Sep 23, 2016

Same issue here!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot find module 'react' - Stack Overflow
I Was facing this issue and in my case, I was referring a .env file and it was missing from my repo. Bring...
Read more >
Cannot use import statement outside a module [React ...
When building a web application, you may encounter the SyntaxError: Cannot use import statement outside a module error.
Read more >
Invalid Hook Call Warning - React
There are three common reasons you might be seeing it: You might have mismatching versions of React and React DOM. You might be...
Read more >
How to Read React Errors (fix 'Cannot read property of ...
The Quick Fix. This error usually means you're trying to use .map on an array, but that array isn't defined yet.
Read more >
Cannot use import statement outside a module at Sample.jsx ...
ReactJS.NET : React.Core 5.2.11, React.AspNet 5.2.11 · JavaScriptEngineSwitcher : JavaScriptEngineSwitcher.V8 3.12.15 · react and react-dom : (N/A if using ...
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