Why Cloudflare Pages May Not Be the Best For Next.js 🤷‍♂️ | Pages Architecture

Поділитися
Вставка
  • Опубліковано 26 сер 2024

КОМЕНТАРІ • 43

  • @luka4695
    @luka4695 17 годин тому

    Genioo, tremendo video!

  • @surgical_17
    @surgical_17 4 місяці тому +1

    I just discovered Cloudflare Pages yesterday, made a static site, and got it working. However, now I know it won't support more complex websites without some sacrifices. Thanks for this video! :)

    • @ThomasDoesDev
      @ThomasDoesDev  4 місяці тому +1

      I'm glad the video was useful to you. I haven't tried Cloudflare Pages for pure static, but it's good to hear that it's working for you. If you make a full stack Next.js app in the future make sure to check out my other videos. So far I have videos on Vercel, AWS Amplify, and Azure Static Web Apps. Hoping to have more soon!

  • @josephgu3558
    @josephgu3558 4 місяці тому +3

    Currently Cloudflare Pages is not a good place to deploy 'Server' Next.js - Edge still has many limitations compared to the backend. But the Cloudflare team is working hard, looking forward to it!

    • @ThomasDoesDev
      @ThomasDoesDev  4 місяці тому

      I really look forward to the improvements to Cloudflare Pages as I've used and like some of the other services they provide.
      Are you a part of the team or know someone on the team. It would be great to get an inside eye on the improvements being made.

    • @josephgu3558
      @josephgu3558 4 місяці тому +1

      @ThomasDoesDev Haha, unfortunately not, I am just an ordinary user who likes Cloudlfare very much😄

    • @ThomasDoesDev
      @ThomasDoesDev  4 місяці тому

      I like it! I'll try to keep up with Next.js updates on Cloudflare Pages. If you hear anything, please reach out and I'll give it another go.

    • @duttaoindril
      @duttaoindril 3 місяці тому

      @josephgu3558 is the app router the way to go?

  • @BigBrotherNaijaAllStar-ob9oc
    @BigBrotherNaijaAllStar-ob9oc 4 місяці тому +6

    I got it working on next.js 14 and i did not have to put the edge run time on all the pages i just had to put it in the layout that the page is using.

    • @codeinProjects3295
      @codeinProjects3295 4 місяці тому +3

      does all the features of Nextjs worked , mainly middleware , SSR , server actions?

    • @ThomasDoesDev
      @ThomasDoesDev  4 місяці тому

      Interesting! Are you using the App Router architecture or Pages?

    • @mikenieva
      @mikenieva 3 місяці тому

      I would like to know too if you could make work the different features.

    • @ThomasDoesDev
      @ThomasDoesDev  3 місяці тому

      @@mikenieva any specific features you were interested in?

  • @abdellahcodes
    @abdellahcodes 2 місяці тому

    You saved me hours if not days of frustration
    Thank you!

    • @ThomasDoesDev
      @ThomasDoesDev  2 місяці тому

      I'm so happy I could help!

    • @abdellahcodes
      @abdellahcodes 2 місяці тому

      @@ThomasDoesDev You should do SST next :)

    • @ThomasDoesDev
      @ThomasDoesDev  2 місяці тому

      You are not the first to recommend SST. I briefly looked at it but hopefully I can again soon

  • @lonehayena
    @lonehayena 3 місяці тому

    I had the same problem first. But now I know what to do it's okay. I deployed about 8 applications after that and they all work like a charm.

    • @ThomasDoesDev
      @ThomasDoesDev  3 місяці тому +1

      Happy to hear you figured it out and Cloudflare is working for you.

  • @soundarajanselvaraj559
    @soundarajanselvaraj559 4 місяці тому +1

    I did not find any proper documents for Coudflare deployment. Thanks for the Video ❤

    • @ThomasDoesDev
      @ThomasDoesDev  4 місяці тому

      You're welcome! I'm glad it was helpful.

  • @divyanshurawat2422
    @divyanshurawat2422 23 дні тому

    getstaticprops not supported, api directory of next.js not supported, dynamic sitemap and robots.txt not supported, dynamic header insertion not supported, express, mongo not supported I have tried these things and they do not work on cl pages.

    • @ThomasDoesDev
      @ThomasDoesDev  15 днів тому

      I'm surprised to hear that getStaticProps did not work for you. The other features I am less surprised. What version of Next.js were you using when you saw getStaticProps not working?

  • @anuragroy11
    @anuragroy11 4 місяці тому

    This was very helpful! Can you do one for Next.js 14?

    • @ThomasDoesDev
      @ThomasDoesDev  4 місяці тому

      Testing Next.js 14 is on the list of To-Do's. Not the highest priority right now. I want to test all providers first.
      Feel free to clone the repo, upgrade to Next.js 14, and test Cloudflare Pages.

  • @shubhpatel7764
    @shubhpatel7764 2 місяці тому

    so, is there any way for image optimisation using cf ? apart from using their cf images product?

    • @ThomasDoesDev
      @ThomasDoesDev  2 місяці тому

      Good question. I haven't used any other services besides the built in Next.js image optimization.
      But I've heard of others using services like Cloudinary or imagekit. I think there are some open source alternatives as well.

    • @biyedesign3346
      @biyedesign3346 2 місяці тому

      Would you consider bunny optimizer? It cost way cheaper than cloudinary and other providers

    • @ThomasDoesDev
      @ThomasDoesDev  2 місяці тому

      I took a quick peek at bunny optimizer and you are correct the pricing is way cheaper. They offer a few other well prices services.

  • @IronWebStudio
    @IronWebStudio 4 місяці тому

    Netlify please

    • @ThomasDoesDev
      @ThomasDoesDev  4 місяці тому

      It's on the list! I can prioritize it because I have experience on Netlify. Should be an easier one to test.

    • @ThomasDoesDev
      @ThomasDoesDev  3 місяці тому +2

      Netlify video is out! ua-cam.com/video/ItyUwNVT1jI/v-deo.html

  • @pencil-jl2qy
    @pencil-jl2qy 3 місяці тому

    I don't know why "Error: An error occurred while evaluating the target edge function (next-on-pages-dist/functions/search.func.js)" appeared when I was trying to deploy this demo. Do you know what might have caused it?

    • @ThomasDoesDev
      @ThomasDoesDev  3 місяці тому

      Thanks the the question.
      Let's see so you are trying to deploy the nextjs-host-check repository to Cloudflare? Are you using the branch named "cloudflare"? It's unlikely that the main branch will deploy properly.
      And the error you see is during the build phase? As in your application is never deployed because the build fails?

    • @pencil-jl2qy
      @pencil-jl2qy 3 місяці тому

      @@ThomasDoesDev Thank you for your response. I tried using the 'cloudflare' branch again, and it worked perfectly. I really appreciate your help!

    • @ThomasDoesDev
      @ThomasDoesDev  3 місяці тому

      Great! Glad to hear that worked.