vercel / next.js

The React Framework
https://nextjs.org
MIT License
125.91k stars 26.87k forks source link

NextConfig redirects method cracked #69269

Closed notlikethiss closed 1 month ago

notlikethiss commented 1 month ago

Link to the code that reproduces this issue

https://pastebin.com/aq4hvvDS

To Reproduce

1.Put in the next.config.js any redirect() method 2.Save config and start dev server 3.Delete redirect() method, clean npm cache, .next folder, node_modules. 4.Start server, but redirect() still working

Current vs. Expected behavior

When i deleted redirect method in next.config this still working without any strokes in config

Provide environment information

Operating System:
  Platform: Windows
  Arch: x86
  Version: 11 23H2
Binaries:
  Node: 21.5.0
  npm: 10.5.1
  Yarn: 1.22.22
  pnpm: N/A
Relevant Packages:
"autoprefixer": "10.4.20",
    "axios": "1.7.4",
    "babel-plugin-styled-components": "2.1.4",
    "dayjs": "1.11.12",
    "htmlparser2": "9.1.0",
    "inter-ui": "3.19.3",
    "mobx": "6.13.1",
    "mobx-react-lite": "4.0.7",
    "next": "14.2.6",
    "postcss": "8.4.41",
    "react": "18.3.1",
    "react-content-loader": "7.0.2",
    "react-dom": "18.3.1",
    "react-google-recaptcha": "3.1.0",
    "react-hook-form": "7.52.2",
    "react-infinite-scroll-component": "6.1.0",
    "react-modal": "3.16.1",
    "react-select": "5.8.0",
    "rxjs": "7.8.1",
    "sharp": "0.33.4",
    "styled-components": "6.1.12",
    "styled-theming": "2.2.0",
    "tailwindcss": "3.4.10"
Next.js Config:
  const nextConfig = {
  webpack: (config) => {
    config.module.rules.push({
      test: /\.svg$/i,
      use: ['@svgr/webpack'],
    });
    return config;
  },
  reactStrictMode: false,
  compiler: {
    styledComponents: true,
    emotion: true,
    reactRemoveProperties: process.env.NODE_ENV !== 'production' ? undefined : { properties: ['^data-test-id$'] },
  },
  output: 'standalone',
  experimental: {},
  eslint: {
    ignoreDuringBuilds: true,
  },
  swcMinify: true,
  images: {
    remotePatterns: [
    ],
  },
};

Which area(s) are affected? (Select all that apply)

Navigation, Output (export/standalone), Runtime

Which stage(s) are affected? (Select all that apply)

next dev (local), next build (local), next start (local)

Additional context

No response

github-actions[bot] commented 1 month ago

We could not detect a valid reproduction link. Make sure to follow the bug report template carefully.

Why was this issue closed?

To be able to investigate, we need access to a reproduction to identify what triggered the issue. We need a link to a public GitHub repository (template for App Router, template for Pages Router), but you can also use these templates: CodeSandbox: App Router or CodeSandbox: Pages Router.

The bug template that you filled out has a section called "Link to the code that reproduces this issue", which is where you should provide the link to the reproduction.

What should I do?

Depending on the reason the issue was closed, you can do the following:

In general, assume that we should not go through a lengthy onboarding process at your company code only to be able to verify an issue.

My repository is private and cannot make it public

In most cases, a private repo will not be a sufficient minimal reproduction, as this codebase might contain a lot of unrelated parts that would make our investigation take longer. Please do not make it public. Instead, create a new repository using the templates above, adding the relevant code to reproduce the issue. Common things to look out for:

I did not open this issue, but it is relevant to me, what can I do to help?

Anyone experiencing the same issue is welcome to provide a minimal reproduction following the above steps by opening a new issue.

I think my reproduction is good enough, why aren't you looking into it quickly?

We look into every Next.js issue and constantly monitor open issues for new comments.

However, sometimes we might miss one or two due to the popularity/high traffic of the repository. We apologize, and kindly ask you to refrain from tagging core maintainers, as that will usually not result in increased priority.

Upvoting issues to show your interest will help us prioritize and address them as quickly as possible. That said, every issue is important to us, and if an issue gets closed by accident, we encourage you to open a new one linking to the old issue and we will look into it.

Useful Resources