Skip to content

Commit

Permalink
[create-cloudflare] next.js with ts fix (#7854)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
4 people authored Feb 10, 2025
1 parent 35c1dc3 commit bff209d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
8 changes: 8 additions & 0 deletions .changeset/famous-coats-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"create-cloudflare": patch
---

Update the Next.js template

- Removed top-level `await` in `next.config.ts` as it is not allowed there and not required.
- Improved `setupDevPlatform()` comment
10 changes: 5 additions & 5 deletions packages/create-cloudflare/templates/next/c3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ const updateNextConfig = (usesTs: boolean) => {
const updatedConfigFile =
`import { setupDevPlatform } from '@cloudflare/next-on-pages/next-dev';
// Here we use the @cloudflare/next-on-pages next-dev module to allow us to use bindings during local development
// (when running the application with \`next dev\`), for more information see:
// Here we use the @cloudflare/next-on-pages next-dev module to allow us to
// use bindings during local development (when running the application with
// \`next dev\`). This function is only necessary during development and
// has no impact outside of that. For more information see:
// https://github.com/cloudflare/next-on-pages/blob/main/internal-packages/next-dev/README.md
if (process.env.NODE_ENV === 'development') {
await setupDevPlatform();
}
setupDevPlatform().catch(console.error);
`.replace(/\n\t*/g, "\n") + configContent;

Expand Down

0 comments on commit bff209d

Please sign in to comment.