Skip to content

Instantly share code, notes, and snippets.

@hanford
Created January 4, 2023 19:41
Show Gist options
  • Save hanford/5ce01eb69b710c7258f9454d262d960b to your computer and use it in GitHub Desktop.
Save hanford/5ce01eb69b710c7258f9454d262d960b to your computer and use it in GitHub Desktop.
diff --git a/node_modules/next/dist/esm/server/base-server.js b/node_modules/next/dist/esm/server/base-server.js
index db135c3..7f1af5c 100644
--- a/node_modules/next/dist/esm/server/base-server.js
+++ b/node_modules/next/dist/esm/server/base-server.js
@@ -296,6 +296,12 @@ export default class Server {
}
addRequestMeta(req, "__nextHadTrailingSlash", pathnameInfo.trailingSlash);
addRequestMeta(req, "__nextIsLocaleDomain", Boolean(domainLocale));
+ let q = {}
+this.dynamicRoutes.forEach(r => {
+ const paramMatch = r.match(parsedUrl.pathname.replace(this.nextConfig.basePath, ''))
+ if (paramMatch) q = {...q, ...paramMatch}
+})
+parsedUrl.query = q
parsedUrl.query.__nextDefaultLocale = defaultLocale;
if (pathnameInfo.locale) {
req.url = formatUrl(url);
diff --git a/node_modules/next/dist/server/initialize-require-hook.js b/node_modules/next/dist/server/initialize-require-hook.js
index 774f9e1..e644086 100644
--- a/node_modules/next/dist/server/initialize-require-hook.js
+++ b/node_modules/next/dist/server/initialize-require-hook.js
@@ -1,7 +1,7 @@
"use strict";
var _requireHook = require("../build/webpack/require-hook");
(0, _requireHook).loadRequireHook();
-const isPrebundled = false;
+const isPrebundled = true;
if (isPrebundled) {
(0, _requireHook).overrideBuiltInReactPackages();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment