https://discord.cloudflare.com logo
Join Discord
Powered by
# frameworks
  • c

    CEbbinghaus

    12/28/2022, 3:32 AM
    When deploying it manually from my local machine rather than through github actions I get this
  • c

    CEbbinghaus

    12/28/2022, 3:32 AM
    https://36244e1c.v2-bat.pages.dev/ here is the corresponding deployment
  • c

    CEbbinghaus

    12/28/2022, 3:32 AM
    oh btw this is written in Svelte using SvelteKit & Cloudflare-Adapter
  • t

    theshadu

    12/28/2022, 10:47 AM
    Hi, I'm having a problem building a react + vite app. This is the error -> 09:29:32.572 (node:1381) ExperimentalWarning: The ESM module loader is experimental. 09:29:32.581 file:///opt/buildhome/repo/node_modules/vite/bin/vite.js:7 09:29:32.581 await import('source-map-support').then((r) => r.default.install()) 09:29:32.581 ^^^^^ 09:29:32.582 09:29:32.582 SyntaxError: Unexpected reserved word 09:29:32.582 at Loader.moduleStrategy (internal/modules/esm/translators.js:81:18) 09:29:32.582 at async link (internal/modules/esm/module_job.js:37:21) 09:29:32.585 npm ERR! code ELIFECYCLE 09:29:32.585 npm ERR! errno 1 09:29:32.586 npm ERR! windmill_template@0.0.0 build:
    tsc && vite build
    09:29:32.586 npm ERR! Exit status 1 09:29:32.587 npm ERR! 09:29:32.587 npm ERR! Failed at the windmill_template@0.0.0 build script. 09:29:32.587 npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 09:29:32.598 09:29:32.598 npm ERR! A complete log of this run can be found in: 09:29:32.598 npm ERR! /opt/buildhome/.npm/_logs/2022-12-28T08_29_32_587Z-debug.log 09:29:32.607 Failed: build command exited with code: 1 09:29:33.548 Failed: an internal error occurred Anyone having this kind of error?
  • t

    theshadu

    12/28/2022, 4:34 PM
    solved. it's needed to define an environment variable 'NODE_VERSION' in CloudFlare deployment config. In my case with the following value: 16.13.2
  • o

    Olvaro

    01/06/2023, 5:12 AM
    I'm running into what I believe is an environmental error with CF Pages. A number of my sites are built using Nuxt.js 2.15.8. Re-running a working deployment from 11 days ago with no changes in my code repository yields below error:
    Copy code
    18:08:42.876     FATAL  Cannot find module 'node:module'
    18:08:42.876    Require stack:
    18:08:42.876    - /opt/buildhome/repo/node_modules/jiti/dist/jiti.js
    18:08:42.877    - /opt/buildhome/repo/node_modules/jiti/lib/index.js
    18:08:42.877    - /opt/buildhome/repo/node_modules/@nuxt/utils/dist/utils.js
    18:08:42.877    - /opt/buildhome/repo/node_modules/@nuxt/cli/dist/cli-index.js
    18:08:42.877    - /opt/buildhome/repo/node_modules/@nuxt/cli/dist/cli.js
    18:08:42.877    - /opt/buildhome/repo/node_modules/nuxt/bin/nuxt.js
    Doing a
    npm update
    and running the same production deployment command on my local development environment works just fine. Any idea what might be happening? Anything I can do on my end to address this?
  • w

    Walshy | Pages

    01/06/2023, 8:38 AM
    There was an update to a dependency. Add the env var
    NODE_VERSION
    with the value
    16
    (For more context see: https://discord.com/channels/595317990191398933/789155108529111069/1060308644077514802)
  • o

    Olvaro

    01/06/2023, 9:42 AM
    Perfect, thanks - deployment working now.
  • h

    hh h

    01/06/2023, 6:35 PM
    Hello everyone! I'm currently having an issue. I am using SvelteKit and I get a lot of Internal 500 errors on all pages. I think this happens because of me using server hooks and setting cookies. Though even without setting cookies, the server side functions (+page.server.js) are also giving me Internal 500 errors. I am not sure what I'm doing wrong.
  • a

    andifined.dev

    01/06/2023, 8:44 PM
    I'm using SvelteKit on pages and it's great, but I'm wondering: the build output contains an auto generated
    _headers
    file and I don't know how to change it. Where is it possible to alter the content of this file?
  • i

    itsuka

    01/07/2023, 6:49 AM
    Has anyone able to successfully set up Next.js 13 + app dir + CSS-in-JS (styled-components in particular) with Cloudflare Pages? The build and deployment was successful, but I saw the following on build log:
    Copy code
    Pages directory cannot be found at /opt/buildhome/repo/pages or /opt/buildhome/repo/src/pages. If using a custom path, please configure with the `no-html-link-for-pages` rule in your eslint config file.
    
    Route (app)                                Size     First Load JS
    ─ ○ /                                      0 B                0 B
    As a result, I got a 404 page on my index, and I had to rollback to standard pages directory. For reference, this is the Next.js guide I followed: https://beta.nextjs.org/docs/styling/css-in-js#styled-components
  • u

    [AEP] Trebel

    01/09/2023, 5:24 PM
    I was watching the #Remix video on CDN Caching (

    https://youtu.be/bfLFHp7Sbkg▾

    ) and find it super interesting, but since we host all our Remix apps on Cloudflare Pages, I believe this doesn't work for us, since Pages run on Workers and Workers are executed in front of the cache, not behind it. Are there any other ways of achieving this, except calling the Cloudflare Cache (or KV) ourselves in the code? We wouldn't be able to make use of the stale-while-revalidate feature, but could still cache requests to external data sources. An alternative would be to migrate the hosting to AWS Lambda and use Cloudflare as CDN, but I really love Cloudflare Pages. I want to migrate a static Eleventy site to Remix, but already know that the WordPress origin hosting the content can’t handle the load. So was thinking if I could make use of the right caching headers and make an easy server-rendered-but-cached version in Remix
  • i

    Isaac McFadyen | YYZ01

    01/09/2023, 6:08 PM
    So Workers have their own Cache implementation. You are correct that the normal CDN cache runs in front of Workers, but Workers can still cache and retrieve things using their own Cache API.
  • i

    Isaac McFadyen | YYZ01

    01/09/2023, 6:08 PM
    It won't stop your Worker from being invoked, but you can still gain speed benefits from caching fetch calls to other sites or caching responses. Just be aware that your Worker will still be triggered and billed.
  • i

    Isaac McFadyen | YYZ01

    01/09/2023, 6:09 PM
  • u

    [AEP] Trebel

    01/09/2023, 7:11 PM
    Thanks! I am aware of the Cache API and have been using it in other Worker implementations 👍 Seems like this is the way to go then! I will have another look at the documentation and see how I can best set this up.
  • u

    [AEP] Trebel

    01/09/2023, 7:11 PM
    Thanks for your help 🙏 I'll see if I can share a code snippet here for future reference when I have it working
  • l

    LimesKey

    01/10/2023, 12:07 PM
    new to this, having a issue building
    node postinstall.js
    with SvelteKit. It builds fine on Github but not on Cloudflare
    limeskey-com-8218f6c0-ecbb-4bd1-9e19-743b77cd999e
  • l

    LimesKey

    01/10/2023, 12:23 PM
    ^ solved
  • l

    LimesKey

    01/10/2023, 12:24 PM
    add the NODE_VERSION enviroment variable of "v16.15.1"
  • h

    Honk!

    01/13/2023, 1:08 AM
    i was curious about something lets say that i have seperate backend with c# and using next js on front so how can i implement pages, do i need to still use workers?
  • m

    monad

    01/13/2023, 11:17 PM
    Where is your C# backend hosted?
  • m

    monad

    01/13/2023, 11:18 PM
    Typically you host your frontend on Pages and backend (serverless) on workers. But with Pages Functions (Workers under the hood) integrations, it's possible to bundle workers directly in your Pages.
  • h

    Honk!

    01/13/2023, 11:26 PM
    aws
  • m

    monad

    01/14/2023, 12:59 AM
    Got it. If you're not using any server side rendering stuff you don't need workers at all.
  • m

    monad

    01/14/2023, 1:00 AM
    On the frontend 'fetch' should be enough to connect your backend?
  • s

    Schmime

    01/15/2023, 2:23 AM
    Could someone from the Cloudflare team please update the Remix Cloudflare pages integration? The dependncies are out of date and it would be great if it used
    renderToReadableString
    thank you friends! https://github.com/remix-run/remix/tree/main/packages/remix-cloudflare-pages
  • g

    geelen

    01/15/2023, 11:01 PM
    @superhighfives 👋
  • g

    geelen

    01/15/2023, 11:01 PM
    this is probably the best channel
  • v

    Vero 🐙

    01/19/2023, 6:10 PM
    ------------------------------ This channel is archived, please use #789155108529111069 or #1063191651796914276 ------------------------------