Skip to content
This repository was archived by the owner on Feb 24, 2026. It is now read-only.

Release 0.18.0 breaks scan of auto-routes (unocss)Β #780

@jods4

Description

@jods4

This commit replaced the auto-routes prefix from __ to \0.

A side-effect that was pointed out in the now removed code comments is that "using \0 like recommended in docs makes the module not be parsed by vite". The presence of this comment makes me think this drawback was initially considered an issue.

This may not seem like much, but here's one edge case:

  • I have metadata in my routes, including an icon class that is used to build a navigation menu automatically;
  • I have instructed Unocss to include in its pipeline **/auto-routes.
  • Since 0.18.0 this file doesn't go through Vite parsing, so (my interpretation:) Unocss doesn't see it anymore.
  • All classes found in that auto-routes metadata are now unknown to Unocss and I have blanks where I used to have icons in my navigation menu.

auto-routes can contain arbitrary user contents/code, from metadata or definePage hooks (beforeLoad, etc.).
Excluding it from Vite parsing can potentially create issues if that content requires compilation/processing, such as my example above.

Can you advise a workaround? Should this be reversed?

There was a link issue #608 saying __ creates conflicts with Firebase. Maybe a different prefix should be picked?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions