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

NextJS App won't build with pnpm #69

Closed
StevenLangbroek opened this issue Apr 26, 2023 · 6 comments
Closed

NextJS App won't build with pnpm #69

StevenLangbroek opened this issue Apr 26, 2023 · 6 comments

Comments

@StevenLangbroek
Copy link

Hey folks! I've followed the quickstart instructions, but am presented with this error when building our app with pnpm on Github Actions:

image

What info can I provide to help reproduce this issue?

@tobiaslins
Copy link
Collaborator

Hey @StevenLangbroek !
Which version of @vercel/analytics do you have in your package.json?

Thanks :)

@StevenLangbroek
Copy link
Author

@tobiaslins it's ^1.0.0, which has resolved to drumroll 1.0.0 :D

@tobiaslins
Copy link
Collaborator

tobiaslins commented Apr 26, 2023

I see you're using next@13.1.6 and I think at that version there was no support for "use client" that was shipped in packages. Can you try to either upgrade to latest Next.js or try wrapping our analytics component before like following:

'use client';

import { Analytics } from '@vercel/analytics/react';

export function VercelWebAnalytics(): JSX.Element {
  return (
    <Analytics />
  );
}

and in layout.tsx use <VercelWebAnalytics />

Let me know if that resolves your issue!

@StevenLangbroek
Copy link
Author

Ahhh that's right yeah, we're a little behind and the migration is a bit painful. Will try the workaround for now, let you know how it goes. Thanks!

@tobiaslins
Copy link
Collaborator

Hey @StevenLangbroek , is it working now? Thanks!

@StevenLangbroek
Copy link
Author

@tobiaslins whoops yes it is! Thanks for the assistance

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

2 participants