-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
[bug] assets not compiling + hmr not working in dev after 6.18.0 #2529
Comments
Are you using Local by Flywheel with Windows? If so, are you running it outside of WSL2? bud.js does not support Windows outside of WSL2. It's kind of awesome that 6.17.x worked with Windows natively, but it was an accident. |
@kellymears Im on an m2 mac, but yea im using Local 🙂 |
@mr-moto this is my experience: bud-6.19.1.movModified lines in app.setPublicPath('/wp-content/themes/sage/public/');
app
.setUrl('http://localhost:3000')
.setPublicUrl('http://flywheel.local:3000')
.setProxyUrl('http://flywheel.local')
.watch(['resources/views', 'app']); project manifest: {
"devDependencies": {
"@roots/bud": "6.19.1",
"@roots/bud-tailwindcss": "6.19.1",
"@roots/sage": "6.19.1"
}
} I didn't have Local installed prior to the bug reports in >=6.19.0, but I set it up on Friday to see what was going on. Everything seems like it works, so I'm kind of stumped at the moment. |
When I set it up I was also under the mistaken impression that Local ran in a Docker container.. it doesn't. So, this simpler setup works as well: app
.setUrl('http://localhost:3000')
.setProxyUrl('http://flywheel.local') |
ok interesting, so it seems as though hmr works when running the dev server through their provided shell. It doesnt work when running the dev server outside of it.. At least its working, any clue as to why that might be? Thanks for pointing me in the right direction! |
I had no idea that was even what was going on until your diagnosis, so thanks to you! The shell script that gets invoked by Local is not much help; I don't see anything special here: export DISABLE_AUTO_TITLE="true"
echo -n -e "\033]0;flywheel Shell\007"
export MYSQL_HOME="[App Support]/Local/run/_QPdg9vDh/conf/mysql"
export PHPRC="[App Support]/Local/run/_QPdg9vDh/conf/php"
export WP_CLI_CONFIG_PATH="/Applications/Local.app/Contents/Resources/extraResources/bin/wp-cli/config.yaml"
export WP_CLI_DISABLE_AUTO_CHECK_UPDATE=1
# Add PHP, MySQL, and WP-CLI to $PATH
echo "Setting Local environment variables..."
export PATH="[App Support]/Local/lightning-services/mysql-8.0.16+6/bin/darwin/bin:$PATH"
export PATH="[App Support]/Local/lightning-services/php-8.1.23+0/bin/darwin-arm64/bin:$PATH"
export PATH="/Applications/Local.app/Contents/Resources/extraResources/bin/wp-cli/posix:$PATH"
export PATH="/Applications/Local.app/Contents/Resources/extraResources/bin/composer/posix:$PATH"
export MAGICK_CODER_MODULE_PATH="[App Support]/Local/lightning-services/php-8.1.23+0/bin/darwin-arm64/ImageMagick/modules-Q16/coders"
echo "----"
echo "WP-CLI: $(wp --version)"
echo "Composer: $(composer --version | cut -f3-4 -d" ")"
echo "PHP: $(php -r "echo PHP_VERSION;")"
echo "MySQL: $(mysql --version)"
echo "----"
cd "[Project Dir]/app/public"
echo "Launching shell: $SHELL ..."
exec $SHELL |
Question: does running it in your normal terminal now work? It does for me. I had installed Local@8.0.0 and was trying to test it with that version and now it works when initiating the shell from Flywheel or from a normal session. I don't know if that's the result of having both versions in It would be nice if I were just trying to develop a site, but I'm trying to troubleshoot something so it's annoying to not be able to replicate the behavior anymore 😂. Flywheel only releasing binary is not helpful either, obviously. As an aside, these settings work for me with the Flywheel generated SSL certificate: app
.serve({
cert: `/Users/kellymears/Library/Application\ Support/Local/run/router/nginx/certs/flywheel.local.crt`,
key: `/Users/kellymears/Library/Application\ Support/Local/run/router/nginx/certs/flywheel.local.key`,
})
.setPublicUrl(`https://flywheel.local:3000`)
.setProxyUrl('https://flywheel.local') Which is very nice to have: @retlehs: this issue is likely relevant to various support requests |
@kellymears still not working in my normal terminal :( for what its worth, the you can see it being used/not used in |
@mr-moto that was a super helpful observation, thank you! |
This fixes #2529 and other associated problems with hot module reload in certain WordPress environments. ## The problem If `SCRIPT_DEBUG` is not set and a script declares `wp-react-refresh-runtime` as a dependency, WordPress will _**silently** omit the entire enqueue request_. What the... 🙈 Bedrock installs don't trigger this behavior because Bedrock defines it: https://github.com/roots/bedrock/blob/master/config/environments/development.php#L14 ## Solution This change omits including `wp-react-refresh-runtime` in `entrypoints.json` and does not externalize `react-refresh/runtime.js` if `SCRIPT_DEBUG` isn't set in a .env file somewhere. ## Type of change **PATCH: backwards compatible change**
Agreement
Describe the issue
When upgrading to 6.18.0+, hmr stops working and assets dont compile properly on the dev server.
running build will compile assets and show correctly but as soon as the dev server is run those changes are lost.
running a fresh install of sage. 6.17.0 works perfectly. checking if hmr is working by changing some tailwind css.
Expected Behavior
Actual Behavior
Steps To Reproduce
version
6.18.0
Logs
No response
Configuration
No response
Relevant .budfiles
The text was updated successfully, but these errors were encountered: