Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Investigate the fetchModule's cloudflare: catch #46

@dario-piotrowicz

Description

@dario-piotrowicz

In fetchModule, if there is an error we have this catch logic:

if (moduleId.startsWith('cloudflare:')) {
const result = {
externalize: moduleId,
type: 'module',
} satisfies vite.FetchResult;
return new MiniflareResponse(JSON.stringify(result));
}

that externalizes cloudflare:* modules

Is this really correct?

Shouldn't cloudflare:* modules be externalized already?

external: [
'cloudflare:email',
'cloudflare:sockets',
'cloudflare:workers',
],

(this probably only applies to build 🤔)

I feel like we might be missing some config here, and we probably should not get cloudflare:* in the fetchModule 🤔
(or if this is ok it should be clear as to why we do need this ad-hoc module handling)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions