miniflare icon indicating copy to clipboard operation
miniflare copied to clipboard

Workers using local modules cannot be mounted

Open jed opened this issue 2 years ago • 1 comments

When using this in my wrangler.toml:

[[build.upload.rules]]
type = "Data"
globs = ["**/*.html"]

And this in my worker.mjs:

import HTML from "chat.html";

miniflare runs fine. But when I try to mount this worker from another worker like this:

[miniflare.mounts]
worker = "../worker"

I get an error like this:

Cause: RangeError: path should be a `path.relative()`d string, but got "../worker/dist/chat.html

jed avatar Apr 16 '22 04:04 jed

Hey! 👋 Thanks for raising this. I've seen this error before and it always confuses me: ../worker/dist/chat.html is definitely a path.relative()d string 😅. I'm pretty busy the next few weeks with exams, but will look into this (potentially using a different glob-matching package) soon. 👍

mrbbot avatar May 20 '22 21:05 mrbbot