{"record":{"id":"2157d62cfbc37e9b","repo":"vercel/next.js","slug":"rspack-core-is-not-available-please-make-sure-th","errorCode":null,"errorMessage":"@rspack/core is not available. Please make sure the appropriate Next.js plugin is installed.","messagePattern":"@rspack/core is not available\\. Please make sure the appropriate Next\\.js plugin is installed\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/next/src/bundles/webpack/packages/webpack.js","lineNumber":44,"sourceCode":"    // eslint-disable-next-line import/no-extraneous-dependencies\n    StringXor: require('webpack/lib/util/StringXor'),\n    // eslint-disable-next-line import/no-extraneous-dependencies\n    NormalModule: require('webpack/lib/NormalModule'),\n    // eslint-disable-next-line import/no-extraneous-dependencies\n    sources: require('webpack').sources,\n    // eslint-disable-next-line import/no-extraneous-dependencies\n    webpack: require('webpack'),\n  })\n} else {\n  Object.assign(exports, require('./bundle5')())\n}\n\nfunction getRspackCore() {\n  try {\n    return require('next-rspack/rspack-core')\n  } catch (e) {\n    if (e instanceof Error && 'code' in e && e.code === 'MODULE_NOT_FOUND') {\n      throw new Error(\n        '@rspack/core is not available. Please make sure the appropriate Next.js plugin is installed.'\n      )\n    }\n\n    throw e\n  }\n}\n","sourceCodeStart":26,"sourceCodeEnd":52,"githubUrl":"https://github.com/vercel/next.js/blob/0ae8c72462952df163f1b1e0726641bc5b40dc93/packages/next/src/bundles/webpack/packages/webpack.js#L26-L52","documentation":"Thrown when NEXT_RSPACK is set so Next.js attempts to use Rspack as the bundler, but the require('next-rspack/rspack-core') call fails with MODULE_NOT_FOUND. The webpack shim getRspackCore() catches the missing-module error and re-throws this user-facing message, telling the developer the Rspack plugin/binding is not installed.","triggerScenarios":"The environment variable NEXT_RSPACK is truthy (often set by the @next/rspack plugin or a CI flag) but the @next/rspack-core / next-rspack package providing rspack-core is absent from node_modules. Also triggered by manually exporting NEXT_RSPACK=1 without installing the matching plugin.","commonSituations":"Opting into the Rspack experiment without running the install step; partial install after a branch switch (pnpm install not re-run); version skew between next and @next/rspack-binding; or a stale lockfile that dropped the optional native dependency. Also seen in monorepos where the plugin is hoisted incorrectly.","solutions":["Install the required Rspack package: `pnpm add @next/rspack-core` (or the documented @next/rspack plugin for your Next.js version).","Re-run `pnpm install` (or npm/yarn equivalent) after a branch switch to materialize the optional native binding.","Unset NEXT_RSPACK if you did not intend to use Rspack — Next.js will fall back to the bundled webpack/Turbopack path.","Verify the installed @next/rspack-core version matches the Next.js major version to avoid resolution failures."],"exampleFix":"# before: NEXT_RSPACK=1 in env but package missing\n# command\nNEXT_RSPACK=1 pnpm build\n# after: install the binding first\npnpm add @next/rspack-core\nNEXT_RSPACK=1 pnpm build","handlingStrategy":"validation","validationCode":"// Verify the rspack binding resolves before building\nfunction assertRspackAvailable() {\n  if (!process.env.NEXT_RSPACK) return\n  try { require.resolve('next-rspack/rspack-core') }\n  catch { throw new Error('NEXT_RSPACK set but next-rspack/rspack-core not installed') }\n}","typeGuard":"function rspackInstalled(): boolean {\n  try { require.resolve('next-rspack/rspack-core'); return true }\n  catch { return false }\n}","tryCatchPattern":null,"preventionTips":["Do not set NEXT_RSPACK unless the @next/rspack plugin is installed and version-matched.","Re-run install after branch switches that touch bundler deps.","In CI, assert require.resolve('next-rspack/rspack-core') before building when NEXT_RSPACK is set.","Keep the @next/rspack-core version in lockstep with the next major version."],"tags":["bundler","rspack","build","configuration","environment"],"analyzedSha":"0ae8c72462952df163f1b1e0726641bc5b40dc93","analyzedAt":"2026-08-06T19:44:29.143Z","schemaVersion":2},"datasetVersion":"2026-08-07T02:17:10.218Z"}