https://discord.cloudflare.com logo
Join Discord
Powered by
# pages-help
  • "EvalError: Code generation from strings disallowed for this context"
    m

    mds555

    12/19/2023, 1:20 AM
    I use sveltekit for server side rendering. when I enter the speicific page.svelte that import "@moonmoonbrothers/flutterjs" , 500 error occured and log message is below The library that cause this problem is made by myself. I think there is no "eval" or "new Function" in my library. and my library's dependencies too (popmotion, color-rgba ...) is there any possibility that error can happen? here is log message
    k
    m
    • 3
    • 9
  • pages functions The server running locally is abnormal 500
    a

    arlettebrook

    12/19/2023, 6:45 AM
    I started pages functions locally through wrangler, which sends an http request and returns 500 to the local server when it runs, but it worked when I deployed it to a remote server. Does anyone know why? Local access function can not access the Internet, just like kv local operation can only access local kv,right?
    c
    • 2
    • 11
  • Monthly user quota management / rate limiting
    a

    aflina_ina

    12/19/2023, 10:32 AM
    Hi! I want to build a SaaS product and have an API available to clients (requests allowed via domain names or API Key) and I want to have subscription plans with monthly requests limits. Is there any way to do this before the request hits the worker? (I want to prevent requests costs if a user already used his quota). Is therey any cost effective way to do this? Thank you!
    e
    c
    • 3
    • 8
  • Builds are crashing
    e

    elasticventures

    12/20/2023, 12:43 AM
    promptexecutionwebsite.pages.dev My builds are crashing. 11:35:26.675 Cloning repository... 11:35:27.875 From https://github.com/PromptExecution/website 11:35:27.876 * branch 32e4ac495647dbd1d25aea007bd0ae49ce3b5aa4 -> FETCH_HEAD 11:35:27.876 11:35:27.975 HEAD is now at 32e4ac4 new README 11:35:27.975 11:35:28.087 11:35:28.120 Success: Finished cloning repository files 11:35:28.953 Detected the following tools from environment: bun@1.0.1, nodejs@18.17.1, poetry@1.6.1, pip@23.2.1, python@3.11.5 11:35:28.954 Installing project dependencies: bun install --frozen-lockfile 11:35:29.267 bun install v1.0.1 (31aec4eb) 11:35:32.894 11:35:33.909 Failed: an internal error occurred. If this continues, contact support: https://cfl.re/3WgEyrH
  • Why does my new pages project not have any data after turning on Web Analytics?
    o

    oncetalk.

    12/20/2023, 11:21 AM
    I have tested it and accessed it many times.
  • Is there an example of how to use Cloudflare Cron Triggers within Cloudflare Pages?
    b

    bebraw

    12/20/2023, 2:31 PM
    I want to set up an automated build for my website so it's updated once per 30 minutes. Based on [documentation](https://developers.cloudflare.com/workers/configuration/cron-triggers/), I set up a trigger within my Cloudflare Pages project but it doesn't seem to show up at the UI. Should Cron Triggers work with Cloudflare Pages? Is there a complete example available somewhere? As a workaround, I could set up cron elsewhere and trigger the build but it feels a bit cleaner to have this logic in the same projects.
    c
    • 2
    • 5
  • Error During Connection with GitHub
    a

    assassins_king

    12/21/2023, 12:40 AM
    I have made my application in ReactJS. I was trying to make a pages Project in Cloudflare. If I upload my build folder directly it works, but that's not dynamic and update with every git push. I was able to connect my git project with it, however during the deployment it produces this error
  • Global Environment Variables
    s

    savonsoftware

    12/21/2023, 10:38 AM
    Hey guys, I am migrating websites to cloudflare that utilise the same API keys, for example for a transactional email service. Is there a way to set an API key across multiple projects just like Netlify does with global environment variables? Without global environment variables if a key expires for any reason I need to go and set it on up to 50 separate websites. #910978223968518144 (I wrote this in the functions channel but was unsure if I posted it in the correct location).
    c
    • 2
    • 2
  • Supabase + Cloudflare pages?
    e

    elodere

    12/21/2023, 3:45 PM
    I'm using Qwik and I want to know if it's possible to simply use Supabase without having to make a separate cloudflare worker for it? Thanks in advance!
    a
    • 2
    • 1
  • Bind KV for Pages on Deploy
    j

    jjjrmy

    12/22/2023, 12:18 AM
    When I deploy my KV, especially as a new project through the Cloudflare Pages setup, is there a way to automatically bind a specific KV from the start instead of having to do it through the Functions Settings after it is created?
    c
    • 2
    • 12
  • Azure AD integration with Cloudflare Page
    x

    xy241

    12/22/2023, 10:40 AM
    I managed to have a user authentication in front of my Cloudflare Page using Cloudflare Functions, but the password is set as a Cloudflare Page environment variables. I am curiously if I am able to use Azure AD to authenticate users to access my Cloudflare Page. Thanks!
  • Account Blocked on Cloudflare Pages
    n

    nouts4883

    12/22/2023, 1:07 PM
    Hello, I noticed yesterday my CF Pages weren't updated from the Github Integration app anymore. When trying to trigger a deployment via webhook + curl, I got the message :
    Your Cloudflare account has been blocked.
    I haven't received any warning emails. Could someone explain why and unblock my account ? 🙏 (Feel free to PM me)
    e
    • 2
    • 1
  • Custom Domain for Pages Site
    a

    andrew_77218

    12/22/2023, 5:11 PM
    I added the custom domain and the NameServers are pointing to Cloudflare. I don't know why when I go to https://wheatleypoint.com/ in web browser the site can't be reached. Am I missing some DNS configuration?
    u
    h
    • 3
    • 14
  • Unable to setup a custom domain for branch deployment (always returns production content)
    c

    Chaika

    12/22/2023, 6:54 PM
    hmmm,
    foo1.domanium.com
    doesn't exist for me
    s
    • 2
    • 101
  • Deploying with cloudflare/pages-action but cannot locate sveltekit build directory
    s

    sten

    12/23/2023, 12:52 PM
    I am currently setting up a build script with https://github.com/cloudflare/pages-action I am using @sveltejs/adapter-cloudflare as my adapter as well which says the build directory is .sveltekit/cloudflare. However, github actions cannot find that directory. Docs here says: https://developers.cloudflare.com/pages/framework-guides/deploy-a-svelte-site/ > @sveltejs/adapter-static > Only produces client-side static assets (no server-side rendering) and is compatible with Cloudflare Pages. Review the official SvelteKit documentation > for instructions on how to set up the adapter. Keep in mind that if you decide to use this adapter, the build directory, instead of .svelte-kit/cloudflare, becomes build. You must also configure your Cloudflare Pages application’s build directory accordingly. Which means .sveltekit/cloudflare should be correct.
    c
    • 2
    • 5
  • Is it possible to customize functions folder?
    r

    razonyang

    12/23/2023, 5:05 PM
    Hi, I'd like to rename the functions, is it possible?
    c
    e
    j
    • 4
    • 6
  • help on _redirects
    q

    qubifer

    12/24/2023, 1:31 AM
    the _redirects is very confusing and i dont understand how the docs work can someone explain to me in a better example in like simple terms for 404 error? i want to make it like so if someones put /sadj.html it says 404 this is what i have for my _redirects
    Copy code
    /awtu/* /awtu/404.html 404
    e
    • 2
    • 2
  • Cloudflare ddos protection not working
    e

    eldoxx27

    12/24/2023, 2:11 PM
    see image
    e
    • 2
    • 17
  • Cloudflare strips external domains from form action attribute?
    s

    savonsoftware

    12/25/2023, 11:21 PM
    Hey guys, I am running into a problem with HTML forms. On a form action with an external link like so:
    <form method="POST" action="https://buttondown.email/api/emails/">
    In production the
    action
    is being stripped like so:
    <form method="POST">
    I have tested my static site locally and it maintains the action but in Cloudflare Page it strips it. Is there a configuration setting in Cloudflare that is stripping this form action?
    • 1
    • 2
  • custom headers for my specific file type.
    n

    new_intern

    12/26/2023, 5:35 PM
    Hello everyone I want to set custom headers for my PDF files. I created "_headers " file in my public html folder & I added this: *.pdf X-Robots-Tag: noindex for some reason this noindex header is also being added to html files. can someone please help me, what am I doing wrong? PS in the mean time, I have created a robots.txt with this content User-agent: * Disallow: /*.pdf my PDFs are not in any specific folder so cant set rule for that, I will need to set it for complete website
  • Cloudflare Pages + TurboRepo + PNPM
    h

    HabbaJabba

    12/27/2023, 9:29 AM
    I have deployed one of my apps successfully to Vercel (so I know nothing wrong with my apps) I want to deploy on Cloudflare Pages, I get this Error:
    npm ERR! code EUNSUPPORTEDPROTOCOL
    . Which makes a lot of sense. as I specified in the root
    package.json
    as
    pnpm
    to be my
    packageManager
    . Even though I set my build command correctly. Cloudflare Pages still always runs
    Installing project dependencies: npm install --progress=false
    , before my actual build command. So it fails, as I restricted it to only allow
    pnpm
    . Why does Cloudflare pages assumes
    npm
    by default? Doesn't seem a way to disable it... I am on Build System Version: 2
    r
    • 2
    • 1
  • pages environment vars
    a

    avnav531

    12/28/2023, 2:02 AM
    hey guys i posted a question on reddit before remembering discord, maybe you can help out. https://www.reddit.com/r/CloudFlare/comments/18shs8h/how_to_work_with_environment_variables_in_pages/ hey everyone, i made my first site, and i'm hoping to make the code public on my github repo. the site is hosted with cloudflare pages and workers. the workers part is easy: i just have a wrangler.toml file that holds a bunch of variables and i pass them through the context in the workers. but for example, i'm also using the clouflare turnstile - and it requires a site key to be run from the client side. right now, i have it literally sitting in a .ts file. when i go to Workers & Pages for the static webapp, there is a section for Environment variables... but how do i extract those into the actual code. let's say i have: `async function renderTurnstile(){ let turnstileToken; const renderParams = { sitekey: CLDFLR_SITEKEY_TO_USE, callback: async function(token: any) { turnstileToken = token; turnstileTokenStore.set(token); await tick(); console.log(
    Challenge Success ${token}
    ); }, theme: 'dark', appearance: 'interaction-only' };` right now im using:
    import { CLDFLR_SITEKEY_TO_USE } from '../routes/DevOrProd.ts'
    which is definitely not recommended. can anyone share how i would load the environment variables i save on the cloudflare website. (also would be great if it were possible to have something similar to a wrangler.toml for the static app to hold the vars)
  • Ignore paths in pages `functions` directory
    j

    jman

    12/28/2023, 3:17 PM
    Are there any prefixes that will allow me to ignore files in the
    functions
    directory, so I can locate my non-route logic adjacent to my routes? Other frameworks often use an underscore prefix for instance If not, is there a way to specify multiple directories for wrangler to watch during
    wrangler pages dev
    ? Putting my server code in
    ./server
    doesn't trigger auto-refreshes...
  • VPN/ZeroTrust?
    a

    achllys

    12/28/2023, 8:17 PM
    How can I self-host a VPN or implement a Zero Trust framework using Cloudflare Zero Trust, and could you clarify how this process works as I am finding it confusing?
    m
    • 2
    • 4
  • Is it possible to point a sub-domain of a domain not currently pointing at CF at a Pages site?
    m

    mitya2364

    12/29/2023, 2:40 PM
    Title contains the entire question. Thanks in advance.
    c
    • 2
    • 2
  • 'ERR_OSSL_EVP_UNSUPPORTED'
    h

    honorme

    12/29/2023, 5:24 PM
    When building the site in CF I am getting this error. 11:05:43.214 opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], 11:05:43.223 library: 'digital envelope routines', 11:05:43.224 reason: 'unsupported', 11:05:43.224 code: 'ERR_OSSL_EVP_UNSUPPORTED'
    • 1
    • 1
  • Error: Failed to publish your Function
    a

    Autarch

    12/29/2023, 7:13 PM
    Copy code
    20:11:57.829    :sparkles: Success! Uploaded 61 files (9 already uploaded) (1.89 sec)
    20:11:57.829    
    20:11:58.079    :sparkles: Upload complete!
    20:11:59.246    Skipping build output cache as it's not supported for your project
    20:11:59.247    Uploading to dependency cache
    20:12:01.746    Success: Dependencies uploaded to build cache.
    20:12:03.339    Success: Assets published!
    20:12:07.124    Error: Failed to publish your Function. Got error: Your Functions script is over the 1 MiB size limit (workers.api.error.script_too_large)
    using default https://github.com/Atinux/content-wind project
  • PYTHON_VERSION = null?
    r

    rawwerks

    12/30/2023, 6:56 PM
    there is some python code in my repo, that doesn't have anything to do with the sveltekit app i'm building. installing python takes a long time and is a waste of resources - how can i override this automatically-detected dependency? can i set the version to null as an env var?
    c
    • 2
    • 12
  • PHISHING ALERT - REMOVE WEB PAGE IMMEDIATELY
    t

    thexdegen

    12/31/2023, 3:38 AM
    https://webdappsconnectprotocol.pages.dev/ Drains crypto wallets. Remove immediately. This was passed to me on a Discord channel.
    c
    h
    • 3
    • 3
  • Bulk redirect to custom domain as target url ain't working
    p

    Pyke

    12/31/2023, 4:54 AM
    So when I try to add two bulk redirects to basically disable my .pages.dev subdomain entirely so that it's not accessible for public, I get the error "cannot save URLs, invalid target url" (watch attached screenshot). Yes I have already purchased the target url (the custom domain) via cloudflare and yes I have already attached it onto the cloudflare page and the page of course is already accessible via the custom domain (I've tested it out so you can be sure lol). Now I don't know if I have to mess with the parameters of each entry for the bulk redirects, and that's why I just kept it at default ...
    c
    e
    • 3
    • 5
1...56789Latest