#Do I need to run npm i @vercel/analytics

12 messages · Page 1 of 1 (latest)

little fiber
#

Do I need to run npm i @vercel/analytics if I'm using just astro/javascript?

Kinda confusing because npm i @vercel/analytics is included in step 2 by default, but if I select Astro + javascript, then that portion isn't visible anymore

long jungleBOT
#
No-one around right now?

It looks like no-one has responded to your question yet. People might not be available right now or don’t know how to answer your question. Want an answer while you wait? Try asking our experimental bot in #1095492539085230272.

rigid belfry
digital fossil
# rigid belfry If you use `@astrojs/vercel` you don't need `@vercel/analytics` package. See h...

Hey, I've followed this guide as well but I can't build my website. I'm using the @astrojs/vercel and in astro.config.mjs file I already added as import vercel from '@astrojs/vercel/serverless'. The issue is, when I run yarn build it displays the following error:

Package subpath './errors' is not defined by "exports" in /home/user/company/website/node_modules/astro/package.json imported from /home/user/company/website/node_modules/@astrojs/vercel/dist/serverless/adapter.js

rigid belfry
digital fossil
#

So could I change it to static as well as in the output?

rigid belfry
#

I guess? If you don't use any SSR, you may switch to static

digital fossil
#

Thanks @rigid belfry I'll give it a go. Will update here!

#

I changed my astro config to static on my import as well as the output, as it was originally. Could WebAnalytics still be set to true under this configuration? 😮

#
import { defineConfig } from 'astro/config';
import vercel from '@astrojs/vercel/static';

export default defineConfig({
  output: 'static',
  adapter: vercel({
    webAnalytics: {
      enabled: true,
    },
  })
});
rigid belfry
#

it works with any output

digital fossil
#

I think I should let it collect data before it shows on the Vercel Dashboard then!