NullVoxPopuli
NullVoxPopuli
CDCloudflare Developers
Created by NullVoxPopuli on 5/12/2024 in #pages-help
can i set the sha for pages deploys with wrangler?
No description
7 replies
CDCloudflare Developers
Created by NullVoxPopuli on 5/11/2024 in #pages-help
how do you tell wrangler to do a preview deploy?
I have this code so far:
- name: Preview ${{ matrix.app.name }}
working-directory: ./deploy-prep-dist/${{ matrix.app.path }}
run: |
npx wrangler pages deploy ./ \
--project-name=${{ matrix.app.cloudflareName }} \
--branch=${{ github.event.workflow_run.head_branch }} \
--commit-hash=${{ github.event.workflow_run.head_commit }}
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
- name: Preview ${{ matrix.app.name }}
working-directory: ./deploy-prep-dist/${{ matrix.app.path }}
run: |
npx wrangler pages deploy ./ \
--project-name=${{ matrix.app.cloudflareName }} \
--branch=${{ github.event.workflow_run.head_branch }} \
--commit-hash=${{ github.event.workflow_run.head_commit }}
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
but it deploys over my production deployment
8 replies
CDCloudflare Developers
Created by NullVoxPopuli on 5/11/2024 in #pages-help
Why is my function middleware not active?
I created a middleware here: https://github.com/NullVoxPopuli/limber/pull/1733/files and locally, testing with npx wrangler has the desired behavior. but when I view my page's latest deploy: https://4186709a.limber-glimmer-tutorial.pages.dev/1-introduction/1-basics the middleware is not active. What debugging steps should I try?
61 replies
CDCloudflare Developers
Created by NullVoxPopuli on 5/8/2024 in #pages-help
I'm incorrectly *not* getting a 404 on some fetch requests. How do I get 404s?
I have code that fetches files with extensions -- and that works great, but when a file is missing, I get the index.html page. I believe this to be wrong behavior. Is there a way to fix, or is this a bug with cloudflare? 😅
28 replies
CDCloudflare Developers
Created by NullVoxPopuli on 3/17/2023 in #pages-help
How do I specify a sub-route for which I do not want SPA fallback to index.html?
On these docs: https://developers.cloudflare.com/pages/platform/serving-pages/ it says that 404 pages fallback to the index.html with a 200 status. Is there a file I can upload with my site that tells cloudflare to 404 for certain paths when pages aren't found? For example, in any sub-route under /docs/ I want no fallback behavior, and 404s to be real
4 replies
CDCloudflare Developers
Created by NullVoxPopuli on 2/15/2023 in #pages-help
I can't get a simple bash script to run due to PATH being mangled?
If support folks want to look: https://dash.cloudflare.com/c67910a047e1510fec6d0d0cf442934c/pages/view/ember-apply/59801594-0a6d-494c-a8e4-cc57a711a5b8 Here is my log (attached, I guess). and my script:
#!/bin/bash
#
echo "For running on Cloudflare builders only"

set -a

npm install --location global pnpm
pnpm i --store=node_modules/.pnpm-store

pnpm_location=$(which pnpm)
export PATH="$PATH:$(dirname $pnpm_location)"

pnpm build:docs
cd packages/docs/
# cloudflare broke all user's Sites that have a "functions" path.
# ... thanks cloudflare. you're usually such a good company :p
#
# - https://github.com/NullVoxPopuli/ember-resources/issues/679
# - https://github.com/TypeStrong/typedoc/issues/2111
# - https://github.com/cloudflare/wrangler2/issues/2240
mv dist/functions dist/funcs
find ./dist -type f -name '*.html' | xargs sed -i.bak --regexp-extended 's:(href="[^"]+)functions/:\1funcs/:g'
#!/bin/bash
#
echo "For running on Cloudflare builders only"

set -a

npm install --location global pnpm
pnpm i --store=node_modules/.pnpm-store

pnpm_location=$(which pnpm)
export PATH="$PATH:$(dirname $pnpm_location)"

pnpm build:docs
cd packages/docs/
# cloudflare broke all user's Sites that have a "functions" path.
# ... thanks cloudflare. you're usually such a good company :p
#
# - https://github.com/NullVoxPopuli/ember-resources/issues/679
# - https://github.com/TypeStrong/typedoc/issues/2111
# - https://github.com/cloudflare/wrangler2/issues/2240
mv dist/functions dist/funcs
find ./dist -type f -name '*.html' | xargs sed -i.bak --regexp-extended 's:(href="[^"]+)functions/:\1funcs/:g'
The need for this script comes from two assumptions: - cloudlfare doesn't support pnpm / have it installed by default - cloudflare brake /functions/ paths But now I get errors like:
08:36:12.838 sh: 1: typedoc: not found
08:36:12.842 undefined
08:36:12.838 sh: 1: typedoc: not found
08:36:12.842 undefined
because of some weird shell behavior. Why is it running under sh when my script is bash?
1 replies