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

[Miniflare 3] Ignore node: and cloudflare: modules when collecting modules #569

Merged
merged 1 commit into from
May 15, 2023

Conversation

mrbbot
Copy link
Contributor

@mrbbot mrbbot commented May 10, 2023

Previously, Miniflare would complain when specifying a script/ scriptPath that used node:/cloudflare: imports with modules: true set. This change updates Miniflare's module collector to ignore them, as they're automatically included by workerd.

@mrbbot mrbbot added the tre Relating to Miniflare 3 label May 10, 2023
@mrbbot mrbbot requested a review from a team May 10, 2023 14:55
@changeset-bot
Copy link

changeset-bot bot commented May 10, 2023

⚠️ No Changeset found

Latest commit: bd9277b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

port: await getPort(),
modules: true,
compatibilityFlags: ["nodejs_compat"],
script: `import { Buffer } from "node:buffer";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a "cloudflare:" import you can also add to this test script?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Answer: not available to import yet, but will be soon

LGTM

Previously, Miniflare would complain when specifying a `script`/
`scriptPath` that used `node:`/`cloudflare:` imports with
`modules: true` set. This change updates Miniflare's module collector
to ignore them, as they're automatically included by `workerd`.
@mrbbot mrbbot force-pushed the tre-node-cloudflare-modules branch from 66c1348 to bd9277b Compare May 15, 2023 15:08
@mrbbot mrbbot merged commit fc1c280 into tre May 15, 2023
@mrbbot mrbbot deleted the tre-node-cloudflare-modules branch May 15, 2023 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tre Relating to Miniflare 3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants