ionic-team / stencil-redux-demo

A small demo showing how to use Redux in a Stencil app with @stencil/redux
MIT License
16 stars 6 forks source link

Adding stencil-router breaks hot reloading #1

Open shendrick opened 6 years ago

shendrick commented 6 years ago

Resources: Before submitting an issue, please consult our docs.

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

 insert the output from npm list @stencil/core here

@stencil/core@0.0.7-2

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: I added the stencil router and when running the dev server and making a change. Bundle rebuilds fine. Then hot reloading breaks, I get a white screen and I get this console error...

Uncaught SyntaxError: Unexpected token < ... build/app/undefined:1

If I stop and restart with npm start, everything is fine again.

Expected behavior: Should hot reload when using stencil router

Steps to reproduce: The issue seemed to start when I added in stencil router.

Related code:

insert any relevant code here

Other information:

shendrick commented 6 years ago

Now I seem to also get this error when rebuilding on every other save.

[49:07.0]  compile finished in 1.40 s

[ ERROR ]  typescript: src/store/index.ts, line: 3
           Cannot find module 'redux-logger'.

      L2:  import thunk from 'redux-thunk';
      L3:  import logger from 'redux-logger';
      L4:  import rootReducer from '../reducers/index';

save once and it happens, second time with a trivial save and works fine, then repeats.

shendrick commented 6 years ago

So it seems like the hot loading issue was related to core and an update fixed that. The redux logger error happening on every other save however, is still happening.

shendrick commented 6 years ago

Hmm.. looks like there's an error in the console if you change the input then go to another page using the router, go back then try changing the input again. It can't seem to find the elm var.

app.core.js:1092 Uncaught (in promise) TypeError: Cannot read property '_values' of null
    at setValue (app.core.js:1092)
    at Page1.setComponentProp (app.core.js:1049)
    at app.core.js:153
    at Array.forEach (<anonymous>)
    at _mapStateToProps (app.core.js:151)
    at app.core.js:157
    at dispatch (home-page.js:481)
    at home-page.js:807
    at home-page.js:69
    at step (home-page.js:61)