Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

context.site is undefined when using the "--site https://foo.com" CLI argument #11731

Closed
1 task
nlnw opened this issue Aug 15, 2024 · 2 comments · Fixed by #11733
Closed
1 task

context.site is undefined when using the "--site https://foo.com" CLI argument #11731

nlnw opened this issue Aug 15, 2024 · 2 comments · Fixed by #11733
Assignees
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority) regression

Comments

@nlnw
Copy link

nlnw commented Aug 15, 2024

Astro Info

Astro                    v4.14.1
Node                     v18.20.3
System                   Linux (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             none

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

all

Describe the Bug

When using the "--site" option, the site should be available through the APIContext, but it now returns undefined. This was working correctly in 4.13.3.

astro dev --site https://foo.com
import type { APIContext } from 'astro';

export async function GET(context: APIContext) {
  return new Response(
    JSON.stringify({
      site: context.site,
    })
  );
}

What's the expected result?

The APIContext.site field should not be undefined.

Link to Minimal Reproducible Example

https://stackblitz.com/edit

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Aug 15, 2024
@Princesseuh Princesseuh added - P4: important Violate documented behavior or significantly impacts performance (priority) regression and removed needs triage Issue needs to be triaged labels Aug 15, 2024
@bluwy bluwy self-assigned this Aug 15, 2024
@nlnw
Copy link
Author

nlnw commented Aug 15, 2024

Now that’s what I call good service! Thanks @bluwy !

@bluwy
Copy link
Member

bluwy commented Aug 15, 2024

I did broke it first, but thanks 😅 (and sorry about that)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority) regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants