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

fix: use publicDir & base for 'include your base in url' error message #9841

Merged
merged 6 commits into from
Feb 1, 2024
Merged

fix: use publicDir & base for 'include your base in url' error message #9841

merged 6 commits into from
Feb 1, 2024

Conversation

kristianbinau
Copy link
Contributor

@kristianbinau kristianbinau commented Jan 27, 2024

Changes

Closes #9759

Fixes error message when requesting a public url without your base.
Now the error message will correctly show the correct publicUrl and will add your base to the expected.

Before / After

With the following config:

export default defineConfig({
  base: "/my-page",
  publicDir: "static"
});

Before:

[ERROR] [router] Request URLs for public/ assets must also include your base. "/favicon.svg" expected, but received "/favicon.svg".

After:

[ERROR] [router] Request URLs for static/ assets must also include your base. "/my-page/favicon.svg" expected, but received "/favicon.svg".

Testing

Didn't feel like this small "text" change needed it's own test : )

Docs

Doesn't change current behavior only makes the error message more clear.

Copy link

changeset-bot bot commented Jan 27, 2024

🦋 Changeset detected

Latest commit: 69f2e2c

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Jan 27, 2024
@kristianbinau kristianbinau marked this pull request as ready for review January 27, 2024 00:56
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@bluwy bluwy merged commit 27ea080 into withastro:main Feb 1, 2024
1 check passed
@astrobot-houston astrobot-houston mentioned this pull request Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error message about missing baseUrl should reflect publicDir config
4 participants