During code review of Nearby, we realized that Nearby had an ES5 module that had a hard dependency on an ES6 module. This leads to an unexpected (rather than silent) error when viewed in older browsers e.g. IE11
Steps to replicate the issue (include links if applicable):
- Create a module "foo" that is not flagged as ES6 code.
- Add "vue" ( which is flagged as ES6 code) as a dependency to the foo declaration
- Add the module unconditionally to the page via OutputPage::addModules
- Load the code in a browser that doesn't support IE11
What happens?:
- In JS console a JS error is thrown (unknown module)
What should have happened instead?:
A JavaScript warning should be logged on all browsers, not just IE11. We know that the dependency chain of an ES5 module importing an ES6 module will not always work.