From 60cc6ebd3e3e5400585ce181f8c648c896d63225 Mon Sep 17 00:00:00 2001 From: John <75003086+ZYJLiu@users.noreply.github.com> Date: Mon, 12 Aug 2024 04:40:59 -0500 Subject: [PATCH] Remove alias config causing all Nextjs App directory paths to error (#8) * remove alias causing app dir routes to throw Error: Cannot read properties of null (reading 'useContext') * remove unused path import from nextjs.config --- next.config.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/next.config.js b/next.config.js index 3f20aab1..cd4b9108 100644 --- a/next.config.js +++ b/next.config.js @@ -6,7 +6,6 @@ const withBundleAnalyzer = require("@next/bundle-analyzer"); const { i18n } = require("./next-i18next.config"); const rewritesAndRedirectsJson = require("./rewrites-redirects.json"); const { builder } = require("@builder.io/sdk"); -const path = require("path"); const securityHeaders = [ { @@ -113,12 +112,6 @@ const moduleExports = () => { ); imageLoaderRule.exclude = /\.inline\.svg$/; - // Alias configuration - config.resolve.alias = { - ...config.resolve.alias, - react: path.resolve(__dirname, "node_modules/react"), - }; - return config; },