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

Error: Cannot find module 'private-next-rsc-mod-ref-proxy' #82

Closed
zhangela opened this issue May 15, 2023 · 2 comments
Closed

Error: Cannot find module 'private-next-rsc-mod-ref-proxy' #82

zhangela opened this issue May 15, 2023 · 2 comments

Comments

@zhangela
Copy link

zhangela commented May 15, 2023

When following instructions (https://vercel.com/docs/concepts/analytics/quickstart) to add Vercel analytics, I'm getting this error:

error - Error: Cannot find module 'private-next-rsc-mod-ref-proxy'
Require stack:
- /Users/zhangela/projects/dispatch/website/.next/server/app/page.js
- /Users/zhangela/projects/dispatch/website/node_modules/next/dist/server/require.js
- /Users/zhangela/projects/dispatch/website/node_modules/next/dist/server/load-components.js
- /Users/zhangela/projects/dispatch/website/node_modules/next/dist/build/utils.js
- /Users/zhangela/projects/dispatch/website/node_modules/next/dist/server/dev/static-paths-worker.js
- /Users/zhangela/projects/dispatch/website/node_modules/next/dist/compiled/jest-worker/processChild.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
    at mod._resolveFilename (/Users/zhangela/projects/dispatch/website/node_modules/next/dist/build/webpack/require-hook.js:23:32)
    at Module._load (node:internal/modules/cjs/loader:841:27)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at eval (webpack-internal:///(sc_server)/./node_modules/@vercel/analytics/dist/react/index.js:2:74)
    at (sc_server)/./node_modules/@vercel/analytics/dist/react/index.js (/Users/zhangela/projects/dispatch/website/.next/server/app/page.js:2529:1)
    at __webpack_require__ (/Users/zhangela/projects/dispatch/website/.next/server/webpack-runtime.js:33:43)
    at eval (webpack-internal:///(sc_server)/./app/layout.tsx:8:81)
    at (sc_server)/./app/layout.tsx (/Users/zhangela/projects/dispatch/website/.next/server/app/page.js:665:1) {
  type: 'Error',
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/zhangela/projects/dispatch/website/.next/server/app/page.js',
    '/Users/zhangela/projects/dispatch/website/node_modules/next/dist/server/require.js',
    '/Users/zhangela/projects/dispatch/website/node_modules/next/dist/server/load-components.js',
    '/Users/zhangela/projects/dispatch/website/node_modules/next/dist/build/utils.js',
    '/Users/zhangela/projects/dispatch/website/node_modules/next/dist/server/dev/static-paths-worker.js',
    '/Users/zhangela/projects/dispatch/website/node_modules/next/dist/compiled/jest-worker/processChild.js'
  ],
  page: '/'
}

and this warning:

Attempted import error: 'Analytics' is not exported from '@vercel/analytics/react' (imported as 'Analytics').

Relevant package.json:

        "@vercel/analytics": "^1.0.1",
        "next": "13.0.8-canary.0",

layout.tsx:


import { Inter } from "@next/font/google";

import "../styles/globals.css";

const inter = Inter({
  subsets: ["latin"],
  variable: "--font-inter",
});

export default function DotComLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en" className={`${inter.variable} h-full scroll-smooth`}>
      <body>
        {children}
        <Analytics />
      </body>
    </html>
  );
}
@zhangela
Copy link
Author

... fixed by updating to latest version of Next.js

@BeaRRRRR
Copy link

BeaRRRRR commented Jun 8, 2023

@zhangela Thank you, you saved me haha! Tried to get it working for a while, when the fix was just updating to the latest version

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