Skip to content

implicit dependency on next.js causing error #172

Description

@marcospgp

Trying to set up vercel analytics on a non next.js project causes the following issue:

$ NODE_ENV=development bun --hot ./src/index.html
 DEV  Bun v1.2.18 ready in 7.54 ms

➜ http://localhost:3000/

Press h + Enter to show shortcuts
177 | import { useParams, usePathname, useSearchParams } from "next/navigation.js";
                                                              ^
error: Could not resolve: "next/navigation.js". Maybe you need to "bun install"?
    at /Users/marcos/Documents/GitHub/bombtimer.dev/node_modules/@vercel/analytics/dist/next/index.mjs:177:57
177 | import { useParams, usePathname, useSearchParams } from "next/navigation.js";
                                                              ^
error: Could not resolve: "next/navigation.js". Maybe you need to "bun install"?
    at /Users/marcos/Documents/GitHub/bombtimer.dev/node_modules/@vercel/analytics/dist/next/index.mjs:177:57

the docs however don't mention this dependency

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions