peaksandpies / universal-analytics

A node module for Google's Universal Analytics and Measurement Protocol
960 stars 147 forks source link

Server-side rendering #45

Open nicolasiensen opened 8 years ago

nicolasiensen commented 8 years ago

Hi,

I'm trying to use this lib into an isomorphic React app that is being rendered in the server-side, and when I import the lib with:

import ua from 'universal-analytics'

I get an error in the cookie.js file:

Uncaught Error: Cannot find module "../package.json"

Is it on the roadmap of this lib to make it work on isomorphic environments?

Thanks!

medeeiros commented 8 years ago

+1

jtillmann commented 8 years ago

Are you sure it's in the cookie.js file? The only cookie.js file is in the though-cookie module used by the request module. And that has no reference to ../package.json.

Since I have no experience with React, could you share some more details?

nicolasiensen commented 8 years ago

Hi @jtillmann, I'm not using this lib in the project anymore.

You can close this issue if you like, or ask @GuilhermeMedeiros to give details about his problem.

Cheers!