Skip to content

Commit 05f0940

Browse files
devjiwonchoimischnic
authored andcommitted
Remove "Restart the dev server if the error persists."
1 parent aa85a00 commit 05f0940

File tree

5 files changed

+6
-8
lines changed

5 files changed

+6
-8
lines changed

crates/next-core/src/middleware.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,7 @@ impl Issue for MiddlewareMissingExportIssue {
201201
- There's a syntax error preventing the export from being recognized.\n\n\
202202
To fix it:\n\
203203
- Check your \"{}\" file.\n\
204-
- Ensure it has either a default or \"{}\" function export.\n\
205-
- Restart the dev server if the error persists.\n\n\
204+
- Ensure it has either a default or \"{}\" function export.\n\n\
206205
Learn more: https://nextjs.org/docs/messages/middleware-to-proxy",
207206
type_description,
208207
migration_bullet,

packages/next/errors.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,5 +900,7 @@
900900
"899": "Both \"%s\" and \"%s\" files are detected. Please use \"%s\" instead. Learn more: https://nextjs.org/docs/messages/middleware-to-proxy",
901901
"900": "Both %s file \"./%s\" and %s file \"./%s\" are detected. Please use \"./%s\" only. Learn more: https://nextjs.org/docs/messages/middleware-to-proxy",
902902
"901": "The file \"%s\" must export a function, either as a default export or as a named \"%s\" export.\\nThis function is what Next.js runs for every request handled by this %s.\\n\\nWhy this happens:\\n- The file exists but doesn't export a function.\\n- The export is not a function (e.g., an object or constant).\\n- There's a syntax error preventing the export from being recognized.\\n\\nTo fix it:\\n- Check your \"%s\" file.\\n- Ensure it has either a default or \"%s\" function export.\\n- Restart the dev server if the error persists.\\n\\nLearn more: https://nextjs.org/docs/messages/middleware-to-proxy",
903-
"902": "The file \"%s\" must export a function, either as a default export or as a named \"%s\" export.\\nThis function is what Next.js runs for every request handled by this %s.\\n\\nWhy this happens:\\n%s- The file exists but doesn't export a function.\\n- The export is not a function (e.g., an object or constant).\\n- There's a syntax error preventing the export from being recognized.\\n\\nTo fix it:\\n- Check your \"%s\" file.\\n- Ensure it has either a default or \"%s\" function export.\\n- Restart the dev server if the error persists.\\n\\nLearn more: https://nextjs.org/docs/messages/middleware-to-proxy"
903+
"902": "The file \"%s\" must export a function, either as a default export or as a named \"%s\" export.\\nThis function is what Next.js runs for every request handled by this %s.\\n\\nWhy this happens:\\n%s- The file exists but doesn't export a function.\\n- The export is not a function (e.g., an object or constant).\\n- There's a syntax error preventing the export from being recognized.\\n\\nTo fix it:\\n- Check your \"%s\" file.\\n- Ensure it has either a default or \"%s\" function export.\\n- Restart the dev server if the error persists.\\n\\nLearn more: https://nextjs.org/docs/messages/middleware-to-proxy",
904+
"903": "The file \"%s\" must export a function, either as a default export or as a named \"%s\" export.\\nThis function is what Next.js runs for every request handled by this %s.\\n\\nWhy this happens:\\n- The file exists but doesn't export a function.\\n- The export is not a function (e.g., an object or constant).\\n- There's a syntax error preventing the export from being recognized.\\n\\nTo fix it:\\n- Check your \"%s\" file.\\n- Ensure it has either a default or \"%s\" function export.\\n\\nLearn more: https://nextjs.org/docs/messages/middleware-to-proxy",
905+
"904": "The file \"%s\" must export a function, either as a default export or as a named \"%s\" export.\\nThis function is what Next.js runs for every request handled by this %s.\\n\\nWhy this happens:\\n%s- The file exists but doesn't export a function.\\n- The export is not a function (e.g., an object or constant).\\n- There's a syntax error preventing the export from being recognized.\\n\\nTo fix it:\\n- Check your \"%s\" file.\\n- Ensure it has either a default or \"%s\" function export.\\n\\nLearn more: https://nextjs.org/docs/messages/middleware-to-proxy"
904906
}

packages/next/src/build/analysis/get-page-static-info.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,7 @@ function validateMiddlewareProxyExports({
411411
`- There's a syntax error preventing the export from being recognized.\n\n` +
412412
`To fix it:\n` +
413413
`- Check your "${relativeFilePath}" file.\n` +
414-
`- Ensure it has either a default or "${fileName}" function export.\n` +
415-
`- Restart the dev server if the error persists.\n\n` +
414+
`- Ensure it has either a default or "${fileName}" function export.\n\n` +
416415
`Learn more: https://nextjs.org/docs/messages/middleware-to-proxy`
417416
)
418417
}

packages/next/src/build/templates/middleware.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ if (typeof handler !== 'function') {
3737
`- There's a syntax error preventing the export from being recognized.\n\n` +
3838
`To fix it:\n` +
3939
`- Check your "${resolvedRelativeFilePath}" file.\n` +
40-
`- Ensure it has either a default or "${fileName}" function export.\n` +
41-
`- Restart the dev server if the error persists.\n\n` +
40+
`- Ensure it has either a default or "${fileName}" function export.\n\n` +
4241
`Learn more: https://nextjs.org/docs/messages/middleware-to-proxy`
4342
)
4443
}

test/e2e/app-dir/proxy-missing-export/proxy-missing-export.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Why this happens:
1414
To fix it:
1515
- Check your "./proxy.ts" file.
1616
- Ensure it has either a default or "proxy" function export.
17-
- Restart the dev server if the error persists.
1817
1918
Learn more: https://nextjs.org/docs/messages/middleware-to-proxy`
2019

0 commit comments

Comments
 (0)