Comments (6)
@mnicpt can you take a look at ^^?
from beaver-logger.
(it would be good to add a jest test with env:node so we can quickly see if any future calls to window
cause the same issue in a non-browser env)
from beaver-logger.
@mnicpt I think it is meant for client-side, but with server-side rendering, e.g. with React server-side rendering, the client-side components and code are rendered on the server, i.e. they are rendered to string to be passed down to client as initial HTML markup.
If uses of window
or other client-side libraries are contained to lifecycle methods, e.g. on click handlers, React useEffect
, etc., then we're okay bc those processes won't execute on the server. But in this specific case, the event listeners are being added to window
in the "main thread"/index.js of this package. Thus, when it's being rendered on the server, the code is imported, immediately executes and fails.
from beaver-logger.
@kweiberth This has been merged and will be deployed this week sometime. Thanks.
from beaver-logger.
In the meantime, I was able to lock in at [email protected]
and avoid this issue.
from beaver-logger.
@bluepnume I thought Logger was meant for client-side only. Should @kweiberth be creating a custom logger that he can configure with the express endpoint on the server? We reference the window
all over the place in logger.js.
from beaver-logger.
Related Issues (20)
- logLevel not defined in docs HOT 3
- Problem with zalgo-promise HOT 7
- Encryption HOT 2
- ES6 import support
- enable/disable log queuing HOT 1
- Importing server-side module error HOT 3
- React Native - window.location.protocol undefined HOT 2
- disable browser console logging HOT 4
- window.location.protocol !== constants_PROTOCOL.FILE
- Create TypeScript typings HOT 13
- Create CHANGELOG.md [Hacktoberfest] HOT 1
- Use page lifecycle APIs instead of window unload event (discussion needed) HOT 2
- SyntaxError: missing ) after argument list HOT 3
- SSR broken with latest version 4.0.32 HOT 1
- timestamp should be an int?
- Demo issues
- Payload values should override builder provided payload props HOT 1
- Consider bringing back `silent` config option to silence console.logs.
- Improve `.metric()` API HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from beaver-logger.