Hi,
First of all, thanks for the great work done in root.
I’m wordking with Laravel Homestead to develop in local a bedrock+sage proyect.
When I run “npm run dev” compiles it, but not whatch any changes. In serve url (http://192.168.10.10:3005) HMR is connected but not reloading.
Request URL: http://192.168.10.10:3005/__bud/hmr
Request Method: GET
Status Code: 200 OK
Remote Address: 192.168.10.10:3005
Referrer Policy: strict-origin-when-cross-origin
While in proxy url get a 404 errror
Request URL: http://my-site.local/__bud/hmr
Request Method: GET
Status Code: 404 Not Found
Remote Address: 192.168.10.10:80
Referrer Policy: strict-origin-when-cross-origin
As you can see, time to compile is extremelly hight and not are shown “watching for changes” in terminal.
> dev
> bud dev
⠋ 98% emitting
◯ js/app.js 248.07 kB
◯ js/editor.js 220.94 kB
◯ manifest.json 170 bytes
◯ entrypoints.json 61 bytes
◯ wordpress.json 33 bytes
◯ images/.gitkeep 0 bytes
duration 22s 304ms
mode development hash b30fe7ba61c1e5d837ec
@roots/bud 6.3.3 webpack 5.73.0
node 16.16.0
server url: http://192.168.10.10:3005/
proxy url: http://my-site.local/
webpack built bud b30fe7ba61c1e5d837ec in 22304ms
This is the build compile for context, where you can see how the first time to proccess is under 2s:
> build
> bud build
⠹ 98% emitting
◉ css/app.78bd48.css 8.41 kB
◉ js/runtime.8eb29a.js 1.02 kB
◉ js/editor.790afc.js 376 bytes
◉ js/575.baac18.js 232 bytes
◉ js/app.3c1997.js 222 bytes
◉ css/editor.31d6cf.css 0 bytes
◯ manifest.json 277 bytes
◯ entrypoints.json 220 bytes
◯ wordpress.json 33 bytes
◯ images/.gitkeep.31d6cf 0 bytes
duration 24s 987ms (1s 404ms + 23s 583ms)
mode production hash 91b91d8343451b5ac422
@roots/bud 6.3.3 webpack 5.73.0
node 16.16.0
This is my package.json:
{
"name": "sage",
"private": true,
"browserslist": [
"extends @roots/browserslist-config/current"
],
"engines": {
"node": ">=16.0.0"
},
"scripts": {
"dev": "bud dev",
"build": "bud build",
"translate": "yarn translate:pot && yarn translate:update",
"translate:pot": "wp i18n make-pot . ./resources/lang/sage.pot --include=\"app,resources\"",
"translate:update": "for filename in ./resources/lang/*.po; do msgmerge -U $filename ./resources/lang/sage.pot; done; rm -f ./resources/lang/*.po~",
"translate:compile": "yarn translate:mo && yarn translate:js",
"translate:js": "wp i18n make-json ./resources/lang --pretty-print",
"translate:mo": "wp i18n make-mo ./resources/lang ./resources/lang"
},
"devDependencies": {
"@roots/bud": "6.3.3",
"@roots/bud-sass": "^6.3.5",
"@roots/bud-tailwindcss": "6.3.3",
"@roots/sage": "6.3.3"
},
"dependencies": {
"@alpinejs/collapse": "^3.10.3",
"@fortawesome/fontawesome-svg-core": "^6.1.2",
"@fortawesome/free-brands-svg-icons": "^6.1.2",
"@fortawesome/pro-light-svg-icons": "^6.1.2",
"@fortawesome/pro-solid-svg-icons": "^6.1.2",
"@glidejs/glide": "^3.5.2",
"alpinejs": "^3.10.3"
}
}
And this is my bud.config.mjs:
/**
* Build configuration
*
* @see {@link https://bud.js.org/guides/getting-started/configure}
* @param {import('@roots/bud').Bud} app
*/
export default async (app) => {
app
/**
* Application entrypoints
*/
.entry({
app: ["@scripts/app", "@styles/app"],
editor: ["@scripts/editor", "@styles/editor"],
})
/**
* Directory contents to be included in the compilation
*/
.assets(["images"])
/**
* Matched files trigger a page reload when modified
*/
.watch([
'tailwind.config.cjs',
'resources/views/**/*',
'resources/styles/**/*',
'app/**/*'
])
/**
* Proxy origin (`WP_HOME`)
*/
.proxy("http://my-site.local")
/**
* Development origin
*/
.serve("http://192.168.10.10:3005")
/**
* URI of the `public` directory
*/
/* Set public path */
// .setPublicPath(app.isDevelopment ? "/" : "")
.setPublicPath(app.isDevelopment ? "/app/themes/my-site/public/" : "app/themes/my-site/public/")
};
Could you see where is the problem here? I’ve been trying to figuring this out for and entire day, reading all topics related but nothing work.
I’have also installed a fresh install of bedrock+sage with nothing extra installed and same problem comes up.