๐ Compatibility Dates
Compatibility Dates
Like the Workers runtime, Miniflare uses compatibility dates to opt-into backwards-incompatible changes from a specific date. If one isn't set, it will default to some time far in the past.
$ miniflare --compat-date 2021-11-12
wrangler.tomlcompatibility_date = "2021-11-12"
const mf = new Miniflare({ compatibilityDate: "2021-11-12",});
Compatibility Flags
Miniflare also lets you opt-in/out of specific changes using compatibility flags:
$ miniflare --compat-flag formdata_parser_supports_files --compat-flag durable_object_fetch_allows_relative_url
wrangler.tomlcompatibility_flags = [ "formdata_parser_supports_files", "durable_object_fetch_allows_relative_url"]
const mf = new Miniflare({ compatibilityFlags: [ "formdata_parser_supports_files", "durable_object_fetch_allows_relative_url", ],});
Specifically Miniflare supports the following flags:
nodejs_compat
(specifically thenode:assert
,node:async_hooks
,node:buffer
,node:events
,node:util
modules)transformstream_enable_standard_constructor
/transformstream_disable_standard_constructor
streams_enable_constructors
/streams_disable_constructors
export_commonjs_default
/export_commonjs_namespace
r2_list_honor_include
global_navigator
/no_global_navigator
durable_object_fetch_requires_full_url
/durable_object_fetch_allows_relative_url
fetch_refuses_unknown_protocols
/fetch_treats_unknown_protocols_as_http
formdata_parser_supports_files
/formdata_parser_converts_files_to_strings
html_rewriter_treats_esi_include_as_void_tag