Skip to content

import.meta.glob works in script but breaks in template #7671

@janosh

Description

@janosh

Describe the bug

The following errors

<script>
  console.log(import.meta.glob(`./*`))  // works
</script>

<!-- breaks -->
{import.meta.glob(`./*`)}

[plugin:vite:import-glob] Invalid glob import syntax: Expect CallExpression, got BinaryExpression

Reproduction

https://stackblitz.com/edit/sveltejs-kit-template-default-khnpjr?file=src%2Froutes%2F%2Blayout.svelte&terminal=devr

Logs

No response

System Info

StackBlitz

Severity

annoyance

Additional Information

No response

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