Deploy a NextJS App on Cloudflare Workers

Поделиться
HTML-код
  • Опубликовано: 3 фев 2025

Комментарии • 40

  • @devhims
    @devhims 3 месяца назад +26

    would have loved a more indepth tutorial focused on next15 with server actions, route handlers, middleware setup etc.

  • @epireve
    @epireve 2 месяца назад +2

    Hey Confidence! I know you from Appsmith several years ago. Good to see you with Cloudflare now brother

  • @Kimitri
    @Kimitri 2 месяца назад +4

    Whats the difference between deploying with Workers and deploy with Cloudflare Pages with next-on-pages?

  • @KingDurable
    @KingDurable Месяц назад +2

    I'm really los with what I'm missing here:
    > preview:worker
    > npm run build:worker && npm run dev:worker
    > build:worker
    > cloudflare
    sh: cloudflare: command not found
    Do I need to install something else?

    • @matiasportales5755
      @matiasportales5755 Месяц назад

      The same thing happens to me, did you manage to solve it?

    • @matiasportales5755
      @matiasportales5755 Месяц назад +1

      From what I saw in the documentation instead of Cloudflare, it is placed: openNextJS-Cloudflare

    • @KingDurable
      @KingDurable Месяц назад

      @@matiasportales5755 No I did not, sadly I gave up, not enough time.

  • @vivamohammadi
    @vivamohammadi 3 месяца назад +2

    Thanks for this update! Is it possible to use the Hono framework as the Next.js API (in the /api folder of Next.js) and deploy it on Cloudflare?

    • @FranciscoMarcosMilhomemAbreu
      @FranciscoMarcosMilhomemAbreu 3 месяца назад

      I think it is not possible. You need to run two commands to be live in background, and the production environment requires to run only one command. You can run your hono API in a different service with a different subdomain.

    • @DilwarHossainNoor
      @DilwarHossainNoor 3 месяца назад +3

      Yes you can. With single dev or start command /api starts with Next.js app. So, you can use Hono framework inside Next.js api route. I have already tested this.

  • @FranciscoMarcosMilhomemAbreu
    @FranciscoMarcosMilhomemAbreu 3 месяца назад +3

    Why you don't merge Pages and Workers services to be one?

  • @clamentjohn
    @clamentjohn 3 месяца назад +1

    OpenNext does not support middleware yet. Can't use it in a production app without a middleware.

  • @MuhammadAsim-ss5yj
    @MuhammadAsim-ss5yj 24 дня назад

    Hey can you help me with deploying the Dynamic routes to Cloudflare

  • @GrantSR
    @GrantSR Месяц назад

    Am I correct in my assumption that: Any JavaScript that one could run as a function in a browser can be moved to a Cloudflare Worker instead? Or, only functions that do not modify the DOM within the function?
    I am an old, retired network manager who is looking into Cloudflare as a way to put some hobby webapps online for free. So, I only have a rudimentary knowledge of all this. Right now I am just trying to figure out the extent of what is possible.

  • @Next-Js
    @Next-Js Месяц назад

    Some Next14 apps display correctly but some Next15 or Next14 apps that use Convex don't work correctly :/

  • @sfsadfsadfasdf
    @sfsadfsadfasdf 2 месяца назад

    is this ready for production?

  • @NeilPuttick
    @NeilPuttick 3 месяца назад

    Potentially brilliant🎉 but how does it work with Next15 please?

    • @CloudflareDevelopers
      @CloudflareDevelopers  3 месяца назад +2

      This works fine on Next 15
      - Confidence

    • @NeilPuttick
      @NeilPuttick 3 месяца назад

      @@CloudflareDevelopers I haven't been able to get it to work as not sure opennext is ready.....any advice welcomed, thanks Confidence

  • @ANDRADE605
    @ANDRADE605 2 месяца назад +3

    I am running into an issue when running "preview:worker". I open the url and receive this error: "Error: The script will never generate a response.
    at async Object.fetch (urlToPath)". Any ideas?

  • @sreunaryn
    @sreunaryn 3 месяца назад +1

    Your Worker exceeded the size limit of 1 MiB.

  • @kamleshpaul414
    @kamleshpaul414 3 месяца назад +1

    all deploy is html and js build not nextjs start

  • @pongolibrary
    @pongolibrary 3 месяца назад

    please add deploy feature for windows operating system.

    • @CloudflareDevelopers
      @CloudflareDevelopers  3 месяца назад

      You should be able to deploy just fine on Windows. What issues are you facing?
      - Confidence

  • @waex7089
    @waex7089 3 месяца назад +2

  • @shawng574
    @shawng574 3 месяца назад

    Does data streaming/Suspense work?

    • @shawng574
      @shawng574 27 дней назад

      Still wondering this ☝

  • @Fat_Cat_Fly
    @Fat_Cat_Fly 2 месяца назад

    project from pages, migrate to worker:
    npm run preview:worker
    And then "500 Internal Server Error"
    Error Msg:
    [wrangler:inf] GET / 500 Internal Server Error (121ms)
    [wrangler:inf] GET /_next/static/chunks/webpack-04c090bf27c652c8.js 200 OK (25ms)
    [wrangler:inf] GET /_next/static/chunks/framework-f66176bb897dc684.js 200 OK (24ms)
    [wrangler:inf] GET /_next/static/chunks/main-fa52bf13517a60fb.js 200 OK (7ms)
    [wrangler:inf] GET /_next/static/chunks/pages/_error-1be831200e60c5c0.js 200 OK (10ms)
    [wrangler:inf] GET /_next/static/chunks/pages/_app-6a626577ffa902a4.js 200 OK (14ms)
    [wrangler:inf] GET /_next/static/lQ3m2GaAmAulodIZ6KB0j/_ssgManifest.js 200 OK (12ms)
    [wrangler:inf] GET /_next/static/lQ3m2GaAmAulodIZ6KB0j/_buildManifest.js 200 OK (12ms)