-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Using createServer and trying to build in lib mode gives "[vite:worker-import-meta-url] can not match string template expression." error #8014
Comments
Looks like you're trying to use Vite to bundle Vite, sounds like a tricky and niche thing to fix. And may be best to use a separate esbuild/rollup script to workaround at the meantime. Curious to know what you're doing bundling a dev server though. |
Yes the cutdown repo makes it look a bit odd. The main full repo is using SSR and has a top level module (in Typescript) that builds everything (a fuller example below). It comes from the SSR examples. When I run that module I run it with
|
const theme: 'light' | 'dark' = 'dark' <img
src={new URL(`/src/assets/images/star_big_${theme}.svg`, import.meta.url).href}
alt="icon"
/> @patak-dev @sapphi-red @poyoho I also had the above problems when I was in bulid. The impact of the project is very serious and extensive. Now I can't build normally. I hope you can have a look as soon as possible. Thank you very much for your repair. |
Describe the bug
I want to build a TS file in lib mode for production. The code includes the use of the
createServer
module fromVite
. When I try to build it, the build crashesReproduction
https://github.com/kpturner/vite-bug-minimal
System Info
Used Package Manager
npm
Logs
Validations
The text was updated successfully, but these errors were encountered: