eleventy icon indicating copy to clipboard operation
eleventy copied to clipboard

Setting setServerPassthroughCopyBehavior('passthrough') with Vite not working

Open shoogstoel opened this issue 2 years ago • 2 comments

Operating system

Ubuntu

Eleventy

2.0.1

Describe the bug

When using setServerPassthroughCopyBehavior('passthrough'); in conjunction with '@11ty/eleventy-plugin-vite' results in the following error, when trying to run npx @11ty/eleventy --serve:

Init options have not yet been fetched in the setup callback. This probably means that `init()` has not yet been called.

Are there any known limitations when using Vite as middleware? Is there anything else I have to take care of when using passthrough?

Reproduction steps

No response

Expected behavior

No response

Reproduction URL

No response

Screenshots

No response

shoogstoel avatar Jul 05 '23 09:07 shoogstoel

Running into the same issue - worth noting that it doesn't matter whether server.middlewareMode in Vite settings is true or false.

It also appears that if passthrough behaviour is set to "copy", Vite doesn't seem to pick up changes to copied asset folders to trigger HMR

groenroos avatar Mar 18 '24 13:03 groenroos

Yep, I just stumbled upon this error as well.

asbjornu avatar May 23 '24 14:05 asbjornu