Skip to content

Console warning about MDX initialization sequence when used with Starlight #46

@evadecker

Description

@evadecker

What's happening?

When using AutoImport and Starlight, AutoImport must be placed after the Starlight integration in order to function properly. However, the package throws a warning in the console:

[auto-import] ⚠️ @astrojs/mdx initialized BEFORE astro-auto-import.
Auto imports in .mdx files won’t work!
Move the MDX integration after auto-import in your integrations array in astro.config.

Starlight initializes MDX automatically, and auto-importing seems to work fine when placed afterwards.

Minimal reproduction

https://stackblitz.com/edit/github-jqmc1e?file=astro.config.mjs

(Thanks Chris!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions