github cloudflare/workers-sdk wrangler@2.0.2

latest releases: wrangler@3.57.0, workers-playground@0.0.5, playground-preview-worker@0.0.3...
2 years ago

Patch Changes

  • #947 38b7242 Thanks @GregBrimble! - Updated defaults and help of wrangler pages publish

  • #941 d84b568 Thanks @threepointone! - fix: bundle worker as iife if detected as a service worker

    We detect whether a worker is a "modules" format worker by the presence of a default export. This is a pretty good heuristic overall, but sometimes folks can make mistakes. One situation that's popped up a few times, is people writing exports, but still writing it in "service worker" format. We detect this fine, and log a warning about the exports, but send it up with the exports included. Unfortunately, our runtime throws when we mark a worker as a service worker, but still has exports. This patch fixes it so that the exports are not included in a service-worker worker.

    Note that if you're missing an event listener, it'll still error with "No event handlers were registered. This script does nothing." but that's a better error than the SyntaxError even when the listener was there.

    Fixes #937

Don't miss a new workers-sdk release

NewReleases is sending notifications on new releases.