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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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