Skip to content

Regression: Astro.site no longer available in getStaticPaths() #14575

@reupen

Description

@reupen

Astro Info

Astro                    v5.14.6
Node                     v20.19.1
System                   Linux (x64)
Package Manager          unknown
Output                   static
Adapter                  none
Integrations             @astrojs/mdx
                         @astrojs/sitemap

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

Since version 5.13.10, Astro.site is undefined in getStaticPaths().

This was last working in version 5.13.9.

This looks like the most relevant change in 5.13.10: https://github.com/withastro/astro/pull/14405/files#diff-6b0c74afa525663c451fc84841ec2040e7125f74e732da4ed7584b84896a759dL52

The linked repro is the blog example with pages/blog/[...slug].tsx] modified to demonstrate the problem. The example will run npm run build automatically.

If you run npm install [email protected] && npm run build the problem goes away.

What's the expected result?

It should work as it previously did, where Astro.site contained the URL configured in astro.config.mjs in a URL object.

Note: It’s possible that things other than getStaticPaths() are affected, that’s just where I noticed the problem.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-r3fdruug?file=src%2Fpages%2Fblog%2F%5B...slug%5D.astro

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageIssue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions