docs: add troubleshooting for middlewares (#13764)
This commit is contained in:
@@ -218,6 +218,12 @@ This returns the created brand in the response:
|
||||
}
|
||||
```
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
#### Returned Empty Array
|
||||
|
||||
If you sent a request to the API route and received an empty array in the response, make sure you've correctly created the middleware at `src/api/middlewares.ts` (with correct spelling). This is a common mistake that can lead to the middleware not being applied, resulting in unexpected behavior.
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
@@ -167,6 +167,10 @@ npm run dev
|
||||
Received a request!
|
||||
```
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
If the middleware didn't run, make sure you've correctly created the middleware at `src/api/middlewares.ts` (with correct spelling). This is a common mistake that can lead to the middleware not being applied, resulting in unexpected behavior.
|
||||
|
||||
---
|
||||
|
||||
## When to Use Middlewares
|
||||
|
||||
@@ -46,7 +46,7 @@ export const generatedEditDates = {
|
||||
"app/learn/fundamentals/admin/tips/page.mdx": "2025-10-03T08:35:15.022Z",
|
||||
"app/learn/fundamentals/api-routes/cors/page.mdx": "2025-03-11T08:54:26.281Z",
|
||||
"app/learn/fundamentals/admin/ui-routes/page.mdx": "2025-07-25T06:58:26.149Z",
|
||||
"app/learn/fundamentals/api-routes/middlewares/page.mdx": "2025-07-18T15:20:25.735Z",
|
||||
"app/learn/fundamentals/api-routes/middlewares/page.mdx": "2025-10-16T11:23:37.787Z",
|
||||
"app/learn/fundamentals/modules/isolation/page.mdx": "2025-05-21T15:10:15.499Z",
|
||||
"app/learn/fundamentals/data-models/index/page.mdx": "2025-03-18T07:59:07.798Z",
|
||||
"app/learn/fundamentals/custom-cli-scripts/page.mdx": "2025-07-25T15:32:47.587Z",
|
||||
@@ -72,7 +72,7 @@ export const generatedEditDates = {
|
||||
"app/learn/debugging-and-testing/instrumentation/page.mdx": "2025-06-16T10:40:52.922Z",
|
||||
"app/learn/fundamentals/api-routes/additional-data/page.mdx": "2025-04-17T08:50:17.036Z",
|
||||
"app/learn/fundamentals/workflows/variable-manipulation/page.mdx": "2025-04-24T13:14:43.967Z",
|
||||
"app/learn/customization/custom-features/api-route/page.mdx": "2024-12-09T10:39:30.046Z",
|
||||
"app/learn/customization/custom-features/api-route/page.mdx": "2025-10-16T11:23:11.195Z",
|
||||
"app/learn/customization/custom-features/module/page.mdx": "2025-05-06T16:10:50.090Z",
|
||||
"app/learn/customization/custom-features/workflow/page.mdx": "2024-12-09T14:36:29.482Z",
|
||||
"app/learn/customization/extend-features/extend-create-product/page.mdx": "2025-01-06T11:18:58.250Z",
|
||||
|
||||
@@ -1384,6 +1384,12 @@ This returns the created brand in the response:
|
||||
}
|
||||
```
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
#### Returned Empty Array
|
||||
|
||||
If you sent a request to the API route and received an empty array in the response, make sure you've correctly created the middleware at `src/api/middlewares.ts` (with correct spelling). This is a common mistake that can lead to the middleware not being applied, resulting in unexpected behavior.
|
||||
|
||||
***
|
||||
|
||||
## Summary
|
||||
@@ -8180,6 +8186,10 @@ npm run dev
|
||||
Received a request!
|
||||
```
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
If the middleware didn't run, make sure you've correctly created the middleware at `src/api/middlewares.ts` (with correct spelling). This is a common mistake that can lead to the middleware not being applied, resulting in unexpected behavior.
|
||||
|
||||
***
|
||||
|
||||
## When to Use Middlewares
|
||||
|
||||
Reference in New Issue
Block a user