AOSSIE-Org / AOSSIE-Org/InPactAI

Deprecation Warning: middleware File Must Be Migrated to proxy in Next.js

Đang mở
#207 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
102
Fork
144
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### Is there an existing issue for this?

- [x] I have searched the existing issues

### What happened?

## 📌 Issue Overview

Next.js displays a deprecation warning stating that the `middleware` file convention is no longer supported.
The project currently includes a `middleware.ts` file, which triggers the warning:
This warning appears during development and may break future builds as the middleware API is being phased out.

## 🔍 Steps to Reproduce
1. Run the development server using `npm run dev` or `yarn dev`.
2. Next.js starts compiling the project.
3. During the build, the terminal shows:

4. The app still runs, but with deprecation warnings.

## 🎯 Expected Behavior
- Next.js should load the routing logic without any deprecation warnings.
- The project should use the latest recommended `proxy.ts` convention.

## 🚨 Actual Behavior
- Next.js shows a warning indicating that `middleware.ts` is deprecated.
- This may cause routing or proxy logic to stop working in future Next.js versions.

## 💡 Suggested Fix
- Rename `middleware.ts` to `proxy.ts` as recommended by Next.js.
- Update routing logic to follow the new proxy API.
- Confirm that all internal imports reference `proxy.ts` instead of `middleware.ts`.

### Record

- [x] I agree to follow this project's Code of Conduct
- [x] I want to work on this issue

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.