cf-workers-status-page icon indicating copy to clipboard operation
cf-workers-status-page copied to clipboard

Rewrite to work with wrangler v2

Open androidacy-user opened this issue 2 years ago • 6 comments

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

androidacy-user avatar Mar 01 '23 03:03 androidacy-user

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'
    ╵                    ~~~~~~~~~~~~~~~~~~~

sun816 avatar Mar 15 '23 08:03 sun816

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.

androidacy-user avatar Mar 18 '23 14:03 androidacy-user

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

sun816 avatar Mar 19 '23 12:03 sun816

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.

eidam avatar Mar 19 '23 12:03 eidam

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

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

kallinos95 avatar Apr 25 '23 00:04 kallinos95

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

androidacy-user avatar Apr 25 '23 18:04 androidacy-user