eidam / cf-workers-status-page

Monitor your websites, showcase status including daily history, and get Slack/Telegram/Discord notification whenever your website status changes. Using Cloudflare Workers, CRON Triggers, and KV storage.
https://status-page.eidam.dev
MIT License
2.28k stars 1.39k forks source link

Rewrite to work with wrangler v2 #126

Open androidacy-user opened 1 year ago

androidacy-user commented 1 year ago

Wrangler v1 is no longer supported. Please upgrade this to work with V2.

sun816 commented 1 year ago

in published stage ,there is error: [ERROR] No loader is configured for ".yaml" files: config.yaml

src/functions/cronTrigger.js:1:19:
  1 │ import config from '../../config.yaml'
    ╵                    ~~~~~~~~~~~~~~~~~~~
androidacy-user commented 1 year ago

in published stage ,there is error: [ERROR] No loader is configured for ".yaml" files: config.yaml

src/functions/cronTrigger.js:1:19:
  1 │ import config from '../../config.yaml'
    ╵                    ~~~~~~~~~~~~~~~~~~~

Yeah, that's where I got stuck trying to migrate it and couldn't find any helpful resources.

sun816 commented 1 year ago

There are so much changed from wrangle v1 to v2,I checked cloudflare doc and git action log and change the deploy.yml as below:

deploy yml.txt and wrangler.toml is changed to : name = "cf-workers-status-page" compatibility_date = "2050-09-14" account_id = "" workers_dev = true main = "./index.js"

[build] command = "npm run build"

account_id = ""

type = "webpack"

webpack_config = "node_modules/flareact/webpack"

[triggers]

crons = [" *"]

[site] bucket = "out"

entry-point = "./"

uncomment and adjust following if you are not using GitHub Actions

[env.production]

kv-namespaces = [{binding="KV_STATUS_PAGE", id="xxxx", preview_id=""}]

zone_id="xxx"


It seems deploy on KV is ok and the worker is created with zero config. I guess the question is inside .toml file

eidam commented 1 year ago

Thanks yall for reporting it. I will take a look and push a wrangler upgrade. Though last time I tried I was not very successful, because flareact did not support w2, but will check again.

kallinos95 commented 1 year ago

any updates on this? I've been having the same error with

import config from '../../config.yaml

androidacy-user commented 1 year ago

Thanks yall for reporting it. I will take a look and push a wrangler upgrade. Though last time I tried I was not very successful, because flareact did not support w2, but will check again.

looks like they've fixed it:

https://github.com/flareact/flareact/issues/235