Skip to content

Commit dc74ffe

Browse files
properly align invalid functions in error message (#195)
1 parent 2a159ed commit dc74ffe

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

.changeset/clever-queens-cough.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@cloudflare/next-on-pages': patch
3+
---
4+
5+
fix: properly align invalid functions in error message

src/buildApplication/buildApplication.ts

+16-12
Original file line numberDiff line numberDiff line change
@@ -120,24 +120,28 @@ async function prepareAndBuildWorker(
120120
}
121121

122122
function printInvalidFunctionsErrorMessage(invalidFunctions: string[]): void {
123-
cliError(`
123+
cliError(
124+
`
124125
ERROR: Failed to produce a Cloudflare Pages build from the project.
125126
126-
The following functions were not configured to run with the Edge Runtime:
127-
${invalidFunctions.map(fn => ` - ${fn}`).join('\n')}
127+
The following functions were not configured to run with the Edge Runtime:\n${invalidFunctions
128+
.map(fn => ` - ${fn}`)
129+
.join('\n')}
128130
129-
If this is a Next.js project:
131+
If this is a Next.js project:
130132
131-
- you can read more about configuring Edge API Routes here: https://nextjs.org/docs/api-routes/edge-api-route
132-
133-
- you can try enabling the Edge Runtime for a specific page by exporting the following from your page:
133+
- you can read more about configuring Edge API Routes here: https://nextjs.org/docs/api-routes/edge-api-route
134+
135+
- you can try enabling the Edge Runtime for a specific page by exporting the following from your page:
134136
135-
export const config = { runtime: 'edge' };
137+
export const config = { runtime: 'edge' };
136138
137-
- or you can try enabling the Edge Runtime for all pages in your project by adding the following to your 'next.config.js' file:
139+
- or you can try enabling the Edge Runtime for all pages in your project by adding the following to your 'next.config.js' file:
138140
139-
const nextConfig = { experimental: { runtime: 'edge'} };
141+
const nextConfig = { experimental: { runtime: 'edge'} };
140142
141-
You can read more about the Edge Runtime here: https://nextjs.org/docs/advanced-features/react-18/switchable-runtime
142-
`);
143+
You can read more about the Edge Runtime here: https://nextjs.org/docs/advanced-features/react-18/switchable-runtime
144+
`,
145+
{ spaced: true }
146+
);
143147
}

0 commit comments

Comments
 (0)