Quasar in subfolder issue with hot reload - sockjs.js
-
Hello, I’m developing and running a Quasar project in a subfolder:
Ex: https://apps.mydomain.com/project1
I have set publicPath: ‘/project1/’ in the build object of the quasar.conf.js
The app is working well except the hot reload sockjs.js call fails with a 404 error on the console because it is not using the subfolder, instead it is loading the sockjs-node/info call from the root of the domain:
sockjs.js?b1aa:1606 GET https://apps.mydomain.com/sockjs-node/info?t=1599256287869 404 (Not Found)
What do I need to do to make the sockjs.js hot reload work when running a project in a subfolder environment?
Thanks in advance.
-
@karamcelwrath said in Quasar in subfolder issue with hot reload - sockjs.js:
hot reload
I can imagine that hot reload is only intended to work in development environment, not on an actual domain with sub folders like yours.
Why do you develop on an actual domain in a sub folder in the first place?
-
Good point. I like to develop under the same variables as how prod is going to be. It’d be nice to get the hot reload to work with subfolders in dev. There has to be a way. Anyone know how?
-
Ah like that I understand. I think the hot reload is a feature Webpack delivers. So you could look there for more information:
-
I have this working. Edit
quasar.config.js
and add to thedevServer: {}
block your desired path. In the example below I want the app served from/admin
build: { vueRouterMode: 'hash, // available values: 'hash', 'history' publicPath: '/admin', .... }, devServer: { sockPath: '/admin/sockjs-node', .... }
-
I also found that when proxying with nginx I had to completely stop and restart serving the app in dev mode to make changes to
sockPath
.