cloudflare / wrangler-action

🧙‍♀️ easily deploy cloudflare workers applications using wrangler and github actions
Apache License 2.0
1.25k stars 159 forks source link

[ERROR] No matching export in "node-modules-polyfills:url" for import "URL" #258

Closed Taewan-P closed 6 months ago

Taewan-P commented 6 months ago

Hello,

So I am using this package to auto deploy to my Workers, but the error written in the title occurs and fails. Just using wrangler deploy in my local computer works without a problem.

As I am using "node:url" package, so I added node_compat = true in wrangler.toml.

  ▲ [WARNING] Enabling Node.js compatibility mode for built-ins and globals. This is experimental and has serious tradeoffs. Please see https://github.com/ionic-team/rollup-plugin-node-polyfills/ for more details.

  ✘ [ERROR] No matching export in "node-modules-polyfills:url" for import "URL"

      src/util/handleOrigin.ts:1:8:
        1 │ import {URL} from "node:url";
          ╵         ~~~

  ✘ [ERROR] Build failed with 1 error:

    src/util/handleOrigin.ts:1:8: ERROR: No matching export in "node-modules-polyfills:url" for import "URL"

So as I'm writing the issue, eventually I solved it by manually upgrading the wrangler version used in this action by adding preCommands to 3.53.0. It seems like the wrangler version that this action is using is the issue. (This action is using 3.13.2 right now)

If the wrangler version is just the case, may I upload an PR that changes DEFAULT_WRANGLER_VERSION to the latest version?

Taewan-P commented 6 months ago

Looking at the open Pull Requests, this will be solved when #238 is merged

nprogers commented 6 months ago

@Taewan-P thanks for filing this issue, we are tracking in https://github.com/cloudflare/wrangler-action/issues/261