Skip to content

Update to latest versions of worker and cfg-if#46

Open
Kakapio wants to merge 1 commit intocloudflare:masterfrom
Kakapio:update-dependency
Open

Update to latest versions of worker and cfg-if#46
Kakapio wants to merge 1 commit intocloudflare:masterfrom
Kakapio:update-dependency

Conversation

@Kakapio
Copy link

@Kakapio Kakapio commented Mar 25, 2024

I was working with this tutorial and noticed a [ERROR] Could not resolve "./index_bg.wasm" error.

Found this issue and realized the template has outdated dependencies.

@nicki-krizek
Copy link

The req.cf() changed and now returns Option, so this also has to be modified:

diff --git a/src/lib.rs b/src/lib.rs
index 956901b..12b95f2 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -8,8 +8,8 @@ fn log_request(req: &Request) {
         "{} - [{}], located at: {:?}, within: {}",
         Date::now().to_string(),
         req.path(),
-        req.cf().coordinates().unwrap_or_default(),
-        req.cf().region().unwrap_or("unknown region".into())
+        req.cf().expect("req missing cf").coordinates().unwrap_or_default(),
+        req.cf().expect("req missing cf").region().unwrap_or("unknown region".into())
     );
 }

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

Successfully merging this pull request may close these issues.

2 participants