Skip to content

import.meta.glob breaks in Svelte template #10949

@janosh

Description

@janosh

Describe the bug

First reported in sveltejs/kit#7671.

According to @gtm-nayan

... this is a Vite bug because instead of transforming and replacing just the import.meta.glob('./*') part with an object, it's looking at the whole expression generated by Svelte to coerce the object to a string.

Reproduction

https://stackblitz.com/edit/vitejs-vite-hzfakv?file=package.json,src%2FApp.svelte

Steps to reproduce

No response

System Info

StackBlitz

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions