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
Miniflare errors when trying to dynamically import the cloudflare:socket built-in module in a script that is nested in a directory.
So in a new Miniflare, a worker config including scriptPath: "./script.mjs" the dynamic import would work,
while scriptPath: "./dist/script.mjs" would cause it to crash: (No such module "dist/cloudflare:sockets).
Expected behavior
Builtins should not be imported from the directory defined in scriptPath.
(works well when the miniflare script is in the same directory as the script.
Thanks @kentonv but in my case the import is inside a package. So I just copy the builds of the internal packages I need into the miniflare directory, which is not the best but at least there won't be an unnecessary patch once it's fixed.
Which Cloudflare product(s) does this pertain to?
Miniflare
What version(s) of the tool(s) are you using?
3.20240129.2 [Miniflare]
What version of Node are you using?
18.16.0
What operating system and version are you using?
Mac Sonoma 14.1.1
Describe the Bug
Observed behavior
Miniflare errors when trying to dynamically import the
cloudflare:socket
built-in module in a script that is nested in a directory.So in a
new Miniflare
, a worker config includingscriptPath: "./script.mjs"
the dynamic import would work,while
scriptPath: "./dist/script.mjs"
would cause it to crash: (No such module "dist/cloudflare:sockets
).Expected behavior
Builtins should not be imported from the directory defined in
scriptPath
.(works well when the miniflare script is in the same directory as the script.
Please provide a link to a minimal reproduction
https://github.com/izidormaklary/miniflare-v3-monorepo-issue/tree/cloudflare-builtins-issue
Please provide any relevant error logs
Error: No such module "dist/cloudflare:sockets".
The text was updated successfully, but these errors were encountered: