We're upgrading from Ember 3.28.x to 5.8.x, and have found an issue when starting our Ember server.
We've got no liveReloadBaseUrl config and no baseURL config, but we do have an empty string for our rootURL config.
The problem is that https://github.com/ember-cli/ember-cli-inject-live-reload/blob/master/lib/index.js#L51 checks as follows:
let baseURL = options.liveReloadBaseUrl || options.rootURL || options.baseURL;
...
let baseURLWithoutHost = baseURL.replace(/^https?:\/\/[^/]+/, '');
This is problematic because with an undefined value for both options.liveReloadBaseUrl and options.baseURL, baseURL resolves to undefined and so the .replace call is failing, even though we have a defined value of '' for options.rootURL.
I've added a temporary workaround (setting baseURL to '' in .ember-cli), and that appears to work... however, it would be nice to not have to add this workaround.
Would it be possible to use ?? instead of || for the falsey check?
We're upgrading from Ember 3.28.x to 5.8.x, and have found an issue when starting our Ember server.
We've got no
liveReloadBaseUrlconfig and nobaseURLconfig, but we do have an empty string for ourrootURLconfig.The problem is that https://github.com/ember-cli/ember-cli-inject-live-reload/blob/master/lib/index.js#L51 checks as follows:
This is problematic because with an
undefinedvalue for bothoptions.liveReloadBaseUrlandoptions.baseURL,baseURLresolves toundefinedand so the.replacecall is failing, even though we have a defined value of''foroptions.rootURL.I've added a temporary workaround (setting
baseURLto''in.ember-cli), and that appears to work... however, it would be nice to not have to add this workaround.Would it be possible to use
??instead of||for the falsey check?