Giter VIP home page Giter VIP logo

Comments (5)

daphnesmit avatar daphnesmit commented on July 26, 2024

I was actually coincidentally 5 minutes ago also trying to use your pkg in a nextjs app!
I ran into the same issue.
I was thinking you could send the setting from the createInstance to the provider, add a useeffect there and initialize the instance since useEffect is only run clientside. But I am not sure if that is the prefered solution.
Maybe you could just initialize the script in a dangerouslySetInnerHTML. Get rid of the provider and only let the library be a useMatomo hook. The hook would just check for the matomo instance on the window.
My 2 cents!

from matomo-tracker.

chrisvanmook avatar chrisvanmook commented on July 26, 2024

At least we can use the tracker in a server side environment now without reference errors: https://github.com/Amsterdam/matomo-tracker/releases/tag/v0.1.4

from matomo-tracker.

jonkoops avatar jonkoops commented on July 26, 2024

@chrisvanmook Should we consider this issue resolved now that we can render an application on the server successfully?

from matomo-tracker.

chrisvanmook avatar chrisvanmook commented on July 26, 2024

@chrisvanmook Should we consider this issue resolved now that we can render an application on the server successfully?

I think we should. It doesn't support tracking on the server, however that also seems a bit pointless to support that for now, right?

from matomo-tracker.

jonkoops avatar jonkoops commented on July 26, 2024

Yeah agreed, I am closing this for now. If we ever do feel the need this code should work in an SSR environment including tracking we can deal with it then.

from matomo-tracker.

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.