Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there anyway to get this to work in the Next.js edge environment? #215

Open
jmcannon opened this issue Apr 26, 2023 · 5 comments
Open

Comments

@jmcannon
Copy link

On init, it throws an error Error: The edge runtime does not support Node.js 'http' module.

@tdumitrescu
Copy link
Member

Judging by the restrictions listed here: https://nextjs.org/docs/api-reference/edge-runtime#unsupported-apis it would probably take a ton of work to make this lib usable in that environment (no require statements, all deps in node_modules must use ES modules and not call any native Node.js APIs).

@jmcannon
Copy link
Author

jmcannon commented Apr 29, 2023

Yes, I think you're right. I just fell back to the default Next serverless environment.

@stephenasuncionDEV
Copy link

Yes, I think you're right. I just feel back to the default Next serverless environment.

As an alternative, you can just call via mixpanel's HTTP API using fetch in the edge.

@GorvGoyl
Copy link

GorvGoyl commented Nov 30, 2023

looking for same. If it's too much work, would be easier for you guys to port mixpanel-js library for edge?

@tdumitrescu
Copy link
Member

would be easier for you guys to port mixpanel-js library for edge?

That seems like it would also be a big project, since the browser lib relies on a lot of browser APIs to function correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants