You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(templates): don't use remote bindings in cloudflare template when developing locally (#14063)
### What?
Fixes the remote binding behavior so that they're only used when
deployed or when applying the database migrations.
I've also pinned the Wrangler version to prevent it breaking due to
behavior changes in minor versions.
And I took the opportunity to update the compatibility date, to one that
already includes the MessagePort by default.
### Why?
It turns out the remote binding behavior slightly changed since the beta
until the final release.
As a result, when developing locally, wrangler would connect to the
remote database, which is a big nono
### How?
By making sure the getCloudflareContext() method is not invoked outside
of NODE_ENV === 'production', as the wrangler.jsonc has the "remote"
flag as true for the D1 database and therefore will always point to the
remote database.
Fixes#14041
Co-authored-by: Ricardo Tavares <rtavares@cloudflare.com>
0 commit comments