Skip to content

@expressive-code/plugin-line-numbers missing css file in starlight project #351

Description

@Freymaurer

I followed the installation instructions for the line-number-plugin in starlight (https://expressive-code.com/plugins/line-numbers/)

ec.config.mts
import { pluginLineNumbers } from '@expressive-code/plugin-line-numbers'

console.log("Loading Expressive Code configuration for Starlight...")

/** @type {import('@astrojs/starlight/expressive-code').StarlightExpressiveCodeOptions} */
export default {
  plugins: [pluginLineNumbers()],
}

And the line numbers are displayed but with missing styles:

Image

These are some logs from the terminal running astro:

11:39:21 [WARN] [router] A `getStaticPaths()` route pattern was matched, but no matching static path was found for requested path `/_astro/ec.i21g3.css`.

Possible dynamic routes being matched: node_modules/@astrojs/starlight/routes/static/index.astro.
Entry docs → 404 was not found.
11:39:21 [404] /_astro/ec.i21g3.css 13ms

And these are logs from the browser console:

ec.i21g3.css:1 
            
            
           Failed to load resource: the server responded with a status of 404 (Not Found)
ec.i21g3.css:1 
            
            
           Failed to load resource: the server responded with a status of 404 (Not Found)

Let me know if you have any idea on how to fix this issue, or why i could encounter it. I have no idea how i should start debugging this 😅

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions