#Error after upgraded to Next15

1 messages · Page 1 of 1 (latest)

peak plaza
#

Hello, I updated Next.js older version to Next15 and it give me this error in image and its occurring randomly
i updated the code according to the new documentation

I am using SWR for fetching data.

please help me

upbeat roseBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

gray veldt
#

Did you try deleting the node_modules and .next folders?

peak plaza
#

yes

#

and its occuring randomly

peak plaza
#

<@&752637460550385834>

round harbor
peak plaza
#

sorry, but its urgent

keen locust
past anchor
# peak plaza and its occuring randomly

I understand the compilation error, but we need more details, my friend. Have you used a nextjs migration codemod? Can you show us the behavior of the functions that do fetch? Do you have any specific configuration in next.config.ts?

peak plaza
#

@keen locust here is useGetMyProfile

        return useSWR<ResponseModel<User>>('/api/proxy/Users/GetMyProfile', fetcher, {
        ...dataRefreshSetting1,
        keepPreviousData: true,
    });
}

and the dataRefreshSetting1

export const dataRefreshSetting1 = {
    errorRetryCount: 2, // Retry failed requests twice
    errorRetryInterval: 10 * 1000, // Retry every 5 seconds
    dedupingInterval: 1000 * 60 * 10, // Data stays fresh for 10 seconds
    revalidateOnFocus: false,  // Enable auto-revalidate on focus (optional)
    refreshInterval: 1000 * 60 * 10, // Refresh every 10 mins
    revalidateIfStale: true,  //Enable auto-revalidation when stale (optional)
}
peak plaza
# past anchor I understand the compilation error, but we need more details, my friend. Have yo...

no i don't use the codeMod and here is my next.config

const isProd = process.env.NODE_ENV === 'production';
const BASE_URL_DOMAIN = process.env.BASE_URL_DOMAIN;


const nextConfig = {
  reactStrictMode: true,
  compiler: {
    removeConsole: isProd ? { exclude: ["error"] } : false
  },
  env: {
    API_BASE_URL: process.env.API_BASE_URL || 'https://api.yourdomain.com',
    STORAGE_PASSPHRASE: process.env.STORAGE_PASSPHRASE || 'RandomPassphrase',
    TOKEN: process.env.TOKEN || '',
    PORT: process.env.PORT || 3000,
  },
  images: {
    remotePatterns: [
      {
        protocol: 'https',
        hostname: '**',
        port: '',
        pathname: '**',
      },
    ],
  },
};

export default nextConfig;