Skip to content

Commit bff209d

Browse files
beratbayramBerat BAYRAMvicbCarmenPopoviciu
authored
[create-cloudflare] next.js with ts fix (#7854)
* resolves #925 * fixes issue name * fix(create-cloudflare): update version from major to patch * Revert last 3 commits * fix(create-cloudflare): removed top-level await in next.config.ts * fix(create-cloudflare): typo fix * fix(create-cloudflare): changeset fix * fix(create-cloudflare): Update .changeset/famous-coats-admire.md Co-authored-by: Victor Berchet <[email protected]> * fix(create-cloudflare): Update .changeset/famous-coats-admire.md 2 * fix(create-cloudflare): Update .changeset/famous-coats-admire.md 3 Co-authored-by: Victor Berchet <[email protected]> * fix(create-cloudflare): pnpm fix on changeset --------- Co-authored-by: Berat BAYRAM <[email protected]> Co-authored-by: Victor Berchet <[email protected]> Co-authored-by: Carmen Popoviciu <[email protected]>
1 parent 35c1dc3 commit bff209d

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.changeset/famous-coats-admire.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"create-cloudflare": patch
3+
---
4+
5+
Update the Next.js template
6+
7+
- Removed top-level `await` in `next.config.ts` as it is not allowed there and not required.
8+
- Improved `setupDevPlatform()` comment

packages/create-cloudflare/templates/next/c3.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ const updateNextConfig = (usesTs: boolean) => {
4242
const updatedConfigFile =
4343
`import { setupDevPlatform } from '@cloudflare/next-on-pages/next-dev';
4444
45-
// Here we use the @cloudflare/next-on-pages next-dev module to allow us to use bindings during local development
46-
// (when running the application with \`next dev\`), for more information see:
45+
// Here we use the @cloudflare/next-on-pages next-dev module to allow us to
46+
// use bindings during local development (when running the application with
47+
// \`next dev\`). This function is only necessary during development and
48+
// has no impact outside of that. For more information see:
4749
// https://github.com/cloudflare/next-on-pages/blob/main/internal-packages/next-dev/README.md
48-
if (process.env.NODE_ENV === 'development') {
49-
await setupDevPlatform();
50-
}
50+
setupDevPlatform().catch(console.error);
5151
5252
`.replace(/\n\t*/g, "\n") + configContent;
5353

0 commit comments

Comments
 (0)