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 React dev mode using a base #8428

Merged
merged 1 commit into from
Sep 6, 2023
Merged

Fix React dev mode using a base #8428

merged 1 commit into from
Sep 6, 2023

Conversation

matthewp
Copy link
Contributor

@matthewp matthewp commented Sep 6, 2023

Changes

Testing

  • Tested in a demo project.
  • Can't be tested in our integration tests due to it requiring the browser loading the module.

Docs

N/A, bug fix

@changeset-bot
Copy link

changeset-bot bot commented Sep 6, 2023

🦋 Changeset detected

Latest commit: e1ed7b5

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 pkg: react Related to React (scope) pkg: integration Related to any renderer integration (scope) labels Sep 6, 2023
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.

LGTM. Seems like it's able to serve both with and without a basepath. The error was happening because we inject a script that's processed by Vite. Injecting as an inline script could also solve this.

@matthewp
Copy link
Contributor Author

matthewp commented Sep 6, 2023

Astro's 'head-inline' scripts are non-module scripts so that wouldn't work here. Going with this as it seems to work.

@matthewp matthewp merged commit 67e8348 into main Sep 6, 2023
12 of 13 checks passed
@matthewp matthewp deleted the react-base-path branch September 6, 2023 13:13
@astrobot-houston astrobot-houston mentioned this pull request Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: integration Related to any renderer integration (scope) pkg: react Related to React (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Astro 3.0 dev server error when base path is set and React component loaded
3 participants