You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Astro v3.0.5
Node v18.17.1
System Windows (x64)
Package Manager npm
Output static
Adapter none
Integrations @astrojs/react
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When the base path is set in the Astro config, and an React component is used with the "client" directive, Astro fails to load the webpage only when using the dev server. After the webpage gets build everything works fine. This kind of neglectes any attempts to quickly develop and debug React components. This issue seems a little widespread, as some people on Discord confirmed that it is not only me.
Not replacing __BASE__ with the Astro config.base but with a forward slash / completely solved the problem for me, but I'm not sure it's the proper fix or why it works
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When the base path is set in the Astro config, and an React component is used with the "client" directive, Astro fails to load the webpage only when using the dev server. After the webpage gets build everything works fine. This kind of neglectes any attempts to quickly develop and debug React components. This issue seems a little widespread, as some people on Discord confirmed that it is not only me.
Config is set like this:
The error which prevents load/render of the page is:
Failed to resolve import "/basepath/@react-refresh" from "astro:scripts/before-hydration.js". Does the file exist?
What's the expected result?
Site with React components and a base path set in a config should work in a dev server without any errors.
Link to Minimal Reproducible Example
https://stackblitz.com/github/dallyh/astro-react-refresh-issue
Participation
The text was updated successfully, but these errors were encountered: