When you run cordova run browser --live-reload, the browser opens, but when you save index.html, localhost shuts down with the error "Error: Cannot read property 'prepare' of undefined." How do I fix it?
cordova Error: Cannot read property 'prepare' of undefined
Asked Answered
In plugins -> cordova-plugin-browsersync -> lib -> pluginHook.js, update context.cordova.raw.prepare()
to context.cordova.prepare()
.
Note, while this stops the error and rebuilds the app, the browser doesn't auto refresh. I have to manually refresh to see the changes. However, definitely a step in the right direction.
© 2022 - 2025 — McMap. All rights reserved.