Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite to work with wrangler v2 #126

Open
androidacy-user opened this issue Mar 1, 2023 · 6 comments
Open

Rewrite to work with wrangler v2 #126

androidacy-user opened this issue Mar 1, 2023 · 6 comments

Comments

@androidacy-user
Copy link

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

@sun816
Copy link

sun816 commented Mar 15, 2023

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
Copy link
Author

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
Copy link

sun816 commented Mar 19, 2023

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
Copy link
Owner

eidam commented Mar 19, 2023

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
Copy link

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

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

@androidacy-user
Copy link
Author

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:

flareact/flareact#235

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants