stencil-community / stencil-router

A simple router for Stencil apps and sites

Home Page:https://stenciljs.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hash historyType routing broken on ES5 builds

mariofriz opened this issue · comments

commented

Stencil version: (run npm list @stencil/core from a terminal/cmd prompt and paste output below):

@stencil/core@0.15.1
@stencil/router@0.3.0

I'm submitting a ... (check one with "x")
[ x ] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://stencil-worldwide.slack.com

Current behavior:
When using stencil-router in hash historyType, application no longer works in Firefox / Edge / IE 11.
It is working fine on Chrome which uses ES6 build and not ES5.

Expected behavior:
Application should work on all browser with hash historyType.

Steps to reproduce:

Activate hash historyType:

<stencil-router historyType={'hash'}>
     <stencil-route-switch scrollTopOffset={0}>
          <stencil-route url='/' component='app-home' exact={true} />
          <stencil-route url='/profile/:name' component='app-profile' />
     </stencil-route-switch>
</stencil-router>

Compile using es5 flag to see errors and be able to test on other browsers than Chrome:

"scripts": {
    ...
    "start": "stencil build --dev --watch --serve --es5",
    ...
}

Following error is displayed in console:
image

Related code:

Sample repo:
https://github.com/mariofriz/stencil-app-starter

Might be related with rollup/rollup#2570 ?