Next.js Discord

Discord Forum

"Can't resolve 'private-next-rsc-mod-ref-proxy'" when upgrading from 14.1 to 14.2

Unanswered
Gray Wagtail posted this in #help-forum
Open in Discord
Gray WagtailOP
We have 4 frontend apps in this repo, 2 using pages router and 2 using app router. This only happens in one of them (pages router), any ideas what this is about? Never seen this module or error before and found nothing online.

2 Replies

Gray WagtailOP
The context file being pointed to in the stack trace is just a basic React Context component, uses no modules except React
'use client';

import { createContext, useRef } from 'react';

import type { TenantBaseConfig } from '@nese/config';

export const ConfigContext = createContext<TenantBaseConfig | undefined>(undefined);

interface ConfigProviderProps<T extends TenantBaseConfig = TenantBaseConfig> {
  children: React.ReactNode;
  config: T;
}

export const ConfigProvider = ({ children, config }: ConfigProviderProps) => {
  const memoizedConfig = useRef(config);

  return <ConfigContext.Provider value={memoizedConfig.current}>{children}</ConfigContext.Provider>;
};
Gray WagtailOP
Also this happens if I try to start that app
Error: An error occurred while loading instrumentation hook: Cannot find module '/home/philip/projects/mono/apps/encyclopedia-frontend/.next/server/instrumentation'
Require stack:
- /home/philip/projects/mono/node_modules/next/dist/server/dev/next-dev-server.js
- /home/philip/projects/mono/node_modules/next/dist/server/next.js
- /home/philip/projects/mono/node_modules/next/dist/server/lib/start-server.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
    at /home/philip/projects/mono/node_modules/next/dist/server/require-hook.js:55:36
    at Module._load (node:internal/modules/cjs/loader:984:27)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at mod.require (/home/philip/projects/mono/node_modules/next/dist/server/require-hook.js:65:28)
    at require (node:internal/modules/helpers:179:18)
    at DevServer.runInstrumentationHookIfAvailable (/home/philip/projects/mono/node_modules/next/dist/server/dev/next-dev-server.js:436:51)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Span.traceAsyncFn (/home/philip/projects/mono/node_modules/next/dist/trace/trace.js:154:20)
    at async DevServer.prepareImpl (/home/philip/projects/mono/node_modules/next/dist/server/dev/next-dev-server.js:214:9)
    at async NextServer.prepare (/home/philip/projects/mono/node_modules/next/dist/server/next.js:161:13)
    at async initializeImpl (/home/philip/projects/mono/node_modules/next/dist/server/lib/render-server.js:98:5)
    at async initialize (/home/philip/projects/mono/node_modules/next/dist/server/lib/router-server.js:423:22)
    at async Server.<anonymous> (/home/philip/projects/mono/node_modules/next/dist/server/lib/start-server.js:249:36) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/philip/projects/mono/node_modules/next/dist/server/dev/next-dev-server.js',
    '/home/philip/projects/mono/node_modules/next/dist/server/next.js',
    '/home/philip/projects/mono/node_modules/next/dist/server/lib/start-server.js'
  ]
}