ben
ben
CDCloudflare Developers
Created by ben on 10/24/2024 in #pages-help
I can't get `wrangler dev` to work with kv
Everything works with just vite dev just changed my wrangler.toml to
name = "resourcinator"
compatibility_date = "Latest"
pages_build_output_dir = "./.svelte-kit/cloudflare"

# Environment variables (if needed)
[vars]
# Example: API_KEY = "your_api_key"

# KV Namespace binding for production environment
[[kv_namespaces]]
binding = "RESOURCES_KV"
id = "my_id"
preview_id = "my_id"
name = "resourcinator"
compatibility_date = "Latest"
pages_build_output_dir = "./.svelte-kit/cloudflare"

# Environment variables (if needed)
[vars]
# Example: API_KEY = "your_api_key"

# KV Namespace binding for production environment
[[kv_namespaces]]
binding = "RESOURCES_KV"
id = "my_id"
preview_id = "my_id"
also it's wrangler pages dev, not wrangler dev Internet resources and most stuff is just outdated except for the documentation, which is quite good, congrats
5 replies
CDCloudflare Developers
Created by ben on 10/24/2024 in #pages-help
I can't get `wrangler dev` to work with kv
ok so I should be settings this pages_build_output_dir according to https://developers.cloudflare.com/pages/functions/wrangler-configuration/ What should I set it to? this is .svelte-kit madness, there's no definitive output folder here, more like 4 folders with weird files in them is it .svelte-kit/output/client? why are there so many folders nvm https://developers.cloudflare.com/pages/configuration/build-configuration/#framework-presets
5 replies
CDCloudflare Developers
Created by ben on 10/24/2024 in #pages-help
I can't get `wrangler dev` to work with kv
I also get this when the app build in the deployed pages:
A wrangler.toml file was found but it does not appear to be valid. Did you mean to use wrangler.toml to configure Pages? If so, then make sure the file is valid and contains the `pages_build_output_dir` property. Skipping file and continuing.
A wrangler.toml file was found but it does not appear to be valid. Did you mean to use wrangler.toml to configure Pages? If so, then make sure the file is valid and contains the `pages_build_output_dir` property. Skipping file and continuing.
5 replies
CDCloudflare Developers
Created by ben on 10/24/2024 in #pages-help
I can't get `wrangler dev` to work with kv
package.json
{
"name": "resourcinator",
"version": "0.0.1",
"private": true,
"engines" : {
"node" : "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"scripts": {
"dev": "vite dev",
"dev:cloudflare": "wrangler dev",
"build": "vite build",
"build:cloudflare": "wrangler build",
"preview": "vite preview",
"preview:cloudflare": "wrangler preview",
"deploy:cloudflare": "wrangler publish",
"test": "playwright test",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check . && eslint .",
"format": "prettier --write ."
},
"devDependencies": {
"@playwright/test": "^1.28.1",
"@sveltejs/adapter-cloudflare": "^4.7.3",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"@types/eslint": "^9.6.0",
"eslint": "^9.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.36.0",
"globals": "^15.0.0",
"prettier": "^3.1.1",
"prettier-plugin-svelte": "^3.1.2",
"svelte": "^4.2.7",
"svelte-check": "^4.0.0",
"typescript": "^5.0.0",
"typescript-eslint": "^8.0.0",
"vite": "^5.0.3",
"wrangler": "^3.83.0"
},
"type": "module",
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
{
"name": "resourcinator",
"version": "0.0.1",
"private": true,
"engines" : {
"node" : "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"scripts": {
"dev": "vite dev",
"dev:cloudflare": "wrangler dev",
"build": "vite build",
"build:cloudflare": "wrangler build",
"preview": "vite preview",
"preview:cloudflare": "wrangler preview",
"deploy:cloudflare": "wrangler publish",
"test": "playwright test",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check . && eslint .",
"format": "prettier --write ."
},
"devDependencies": {
"@playwright/test": "^1.28.1",
"@sveltejs/adapter-cloudflare": "^4.7.3",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"@types/eslint": "^9.6.0",
"eslint": "^9.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.36.0",
"globals": "^15.0.0",
"prettier": "^3.1.1",
"prettier-plugin-svelte": "^3.1.2",
"svelte": "^4.2.7",
"svelte-check": "^4.0.0",
"typescript": "^5.0.0",
"typescript-eslint": "^8.0.0",
"vite": "^5.0.3",
"wrangler": "^3.83.0"
},
"type": "module",
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
5 replies
CDCloudflare Developers
Created by FunnyClouds on 8/18/2023 in #general-help
Client certificates question
14 replies
CDCloudflare Developers
Created by FunnyClouds on 8/18/2023 in #general-help
Client certificates question
I have tested my setup with curl by providing the certificate with: curl -L -v --cert-type P12 --cert ./<cert-name>.p12:'<cert-password>' https://<my-domain> and it works, so the issue is definitely that the website does not ask the browser for a certificate
14 replies
CDCloudflare Developers
Created by FunnyClouds on 8/18/2023 in #general-help
Client certificates question
I am also looking to do this and have found very little resources on how to do so. I have set up the rules in WAF and generated certificates, I have also added them to the devices, however the problem that I am facing is that when accessing the page I am not being asked for the certificate, so the browser doesn't use it and cannot get past the rule
14 replies