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

🐛 BUG: wrangler init => wrangler dev --experimental-local => ERR_FUTURE_COMPATIBILITY_DATE #2881

Closed
irvinebroque opened this issue Mar 9, 2023 · 3 comments · Fixed by #3058
Labels
bug Something that isn't working miniflare Relating to Miniflare

Comments

@irvinebroque
Copy link
Contributor

Which Cloudflare product(s) does this pertain to?

Wrangler

What version of Wrangler are you using?

2.12.0

What operating system are you using?

Mac

Describe the Bug

Error:

✘ [ERROR] local worker: MiniflareCoreError [ERR_FUTURE_COMPATIBILITY_DATE]: Compatibility date "2023-03-09" is in the future and unsupported

      at validateCompatibilityDate

Steps to reproduce:

  1. wrangler init
  2. wrangler dev --experimental-local
  3. Observe that the compatibility date is March 9, 2023 (but today, in local time PST, it is March 8, 2023)
  4. Observe error

Is the compatibility date set based on UTC, but then read by comparing local time?

When I change the compatibility date to March 8th, it works, and I get the following when running with the --experimental-local flag:

[mf:wrn] The latest compatibility date supported by the installed Cloudflare Workers Runtime is "2023-02-21",
but you've requested "2023-03-08". Falling back to "2023-02-21"...

I can only reproduce this error when running with --experimental-local.

@irvinebroque irvinebroque added the bug Something that isn't working label Mar 9, 2023
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Mar 9, 2023
@irvinebroque
Copy link
Contributor Author

This manifests itself in Pages as well when using --experimental-local. To reproduce:

  1. Create a Pages project (ex: https://github.com/irvinebroque/pages-nodejs-compat)
  2. Run wrangler pages dev public --experimenta-local --compatibility-flag nodejs_compat
  3. Observe that because using --experimental-local opts you into using Miniflare V3 / workerd, Miniflare attempts to set a compatibility date, and this date is in the future in my current timezone (it's 3/31, but 4/1 in UTC)
✘ [ERROR] local worker: MiniflareCoreError [ERR_FUTURE_COMPATIBILITY_DATE]: Compatibility date "2023-04-01" is in the future and unsupported

@mrbbot
Copy link
Contributor

mrbbot commented Apr 3, 2023

Hey! 👋 Thanks for raising this! Part of this looks similar to #2385, but the timezone stuff is interesting. Will investigate further 👍

@mrbbot mrbbot added the miniflare Relating to Miniflare label Apr 3, 2023
@jefforulez
Copy link

there's definitely a UTC timezone bug here. i ran into the same thing last night ~10:00 pm ET when it was already the next day UTC.

mrbbot added a commit to cloudflare/miniflare that referenced this issue Apr 17, 2023
When a user specifies a compatibility date, Miniflare compares it
against the current date to make sure it's not in the future.
Previously, we used the system timezone when getting the current
date. Wrangler's default compatibility date is the current date in
the _UTC_ timezone. This meant Miniflare occasionally thought
Wrangler's compatibility date was in the future. This change updates
Miniflare to always use UTC when getting the current date.

Closes cloudflare/workers-sdk#2881
mrbbot added a commit to cloudflare/miniflare that referenced this issue Apr 17, 2023
When a user specifies a compatibility date, Miniflare compares it
against the current date to make sure it's not in the future.
Previously, we used the system timezone when getting the current
date. Wrangler's default compatibility date is the current date in
the _UTC_ timezone. This meant Miniflare occasionally thought
Wrangler's compatibility date was in the future. This change updates
Miniflare to always use UTC when getting the current date.

Closes cloudflare/workers-sdk#2881
mrbbot added a commit to cloudflare/miniflare that referenced this issue Apr 17, 2023
When a user specifies a compatibility date, Miniflare compares it
against the current date to make sure it's not in the future.
Previously, we used the system timezone when getting the current
date. Wrangler's default compatibility date is the current date in
the _UTC_ timezone. This meant Miniflare occasionally thought
Wrangler's compatibility date was in the future. This change updates
Miniflare to always use UTC when getting the current date.

Closes cloudflare/workers-sdk#2881
mrbbot added a commit that referenced this issue Apr 17, 2023
mrbbot added a commit that referenced this issue Apr 17, 2023
penalosa pushed a commit that referenced this issue Apr 17, 2023
* Bump `@miniflare/tre` to `3.0.0-next.13`

Closes #2881

* Disable zone validation with `--experimental-local`

Removes login requirement when `routes` where specified in config

Closes #2987

* Disable persistence without `--persist` in `--experimental-local`

Previously, `--experimental-local` would persist data in `$PWD/.mf`
when the `--persist` flag wasn't set. This change switches to using
volatile in-memory storage, that still persists between reloads.

Closes #2995

* Disable verbose `workerd` logging outside of `debug` log level

This hides Wrangler DevTools inspector client connection logs, which
included references to C++ source files. We get `console.log`s from
the inspector too, so don't need `workerd` verbose logging for that.
@github-project-automation github-project-automation bot moved this from Untriaged to Done in workers-sdk Apr 17, 2023
mrbbot added a commit that referenced this issue Oct 31, 2023
When a user specifies a compatibility date, Miniflare compares it
against the current date to make sure it's not in the future.
Previously, we used the system timezone when getting the current
date. Wrangler's default compatibility date is the current date in
the _UTC_ timezone. This meant Miniflare occasionally thought
Wrangler's compatibility date was in the future. This change updates
Miniflare to always use UTC when getting the current date.

Closes #2881
mrbbot added a commit that referenced this issue Nov 1, 2023
When a user specifies a compatibility date, Miniflare compares it
against the current date to make sure it's not in the future.
Previously, we used the system timezone when getting the current
date. Wrangler's default compatibility date is the current date in
the _UTC_ timezone. This meant Miniflare occasionally thought
Wrangler's compatibility date was in the future. This change updates
Miniflare to always use UTC when getting the current date.

Closes #2881
mrbbot added a commit that referenced this issue Nov 1, 2023
When a user specifies a compatibility date, Miniflare compares it
against the current date to make sure it's not in the future.
Previously, we used the system timezone when getting the current
date. Wrangler's default compatibility date is the current date in
the _UTC_ timezone. This meant Miniflare occasionally thought
Wrangler's compatibility date was in the future. This change updates
Miniflare to always use UTC when getting the current date.

Closes #2881
mrbbot added a commit that referenced this issue Nov 1, 2023
When a user specifies a compatibility date, Miniflare compares it
against the current date to make sure it's not in the future.
Previously, we used the system timezone when getting the current
date. Wrangler's default compatibility date is the current date in
the _UTC_ timezone. This meant Miniflare occasionally thought
Wrangler's compatibility date was in the future. This change updates
Miniflare to always use UTC when getting the current date.

Closes #2881
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working miniflare Relating to Miniflare
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants