Code Monkey home page Code Monkey logo

Comments (6)

mstuart avatar mstuart commented on June 1, 2024 1

@mnicpt can you take a look at ^^?

from beaver-logger.

bluepnume avatar bluepnume commented on June 1, 2024 1

(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.

kweiberth avatar kweiberth commented on June 1, 2024 1

@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.

mnicpt avatar mnicpt commented on June 1, 2024 1

@kweiberth This has been merged and will be deployed this week sometime. Thanks.

from beaver-logger.

kweiberth avatar kweiberth commented on June 1, 2024

In the meantime, I was able to lock in at [email protected] and avoid this issue.

from beaver-logger.

mnicpt avatar mnicpt commented on June 1, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.