I have the following line in an Angular lazy loaded module (originally not called 'evilRegex'). It doesn't get executed, only defined - and the RegExp and lazy module work just fine as intended in Chrome.
const evilRegex = new RegExp(/(?<=<)([a-z0-9]+)(?=[ >])/g);
I am getting a ChunkLoadError is raised when the lazy module is loaded, but the URL returned in the error is valid and accessible if loaded directly.
I know that no code is executing because I see this alert box.
loadChildren: () => import(/* webpackChunkName: "pages_home" */ './rr2/page-designer/pages/pages.module')
.then(m => { return m.PagesModule; } ).catch(e => alert('***' + e))
In addition, putting try / catch around it does nothing so the error must be some kind of module load error. It only happens in Safari and only with this exact RegExp - so it's also not a caching issue.
I'm seeing this only on my iPhone so I can't view the console for any errors.
Does Safari not support negative lookbehind Regex? Is it because somehow <=< is tripping over the module parser?
More concerning is perhaps that since the actual error doesn't propagate all I would see in my log files is 'ChunkLoadError' which is indistinguishable from a connection issue.
Note: I am using Safari 14 Beta, but see the same in 13.5. If someone with a Mac could add this to a lazy module - just the definition - I'm hoping it would show some details in the console.