Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reload not working #124

Open
cortopy opened this issue Nov 13, 2018 · 4 comments
Open

Reload not working #124

cortopy opened this issue Nov 13, 2018 · 4 comments

Comments

@cortopy
Copy link

cortopy commented Nov 13, 2018

Code to reproduce the issue:

  1. Run create-cycle-app my-app && cd my-app
  2. Then npm start
  3. Edit some styles. They are loaded ok using HMR
  4. Edit some text in counter.tsx. Webpack recompiles but browser page doesn't change
  5. Refresh page in browser would either leave page blank or webpack seems stuck in Waiting for update signal from WDS

Expected behavior:
Page reloads after webpack recompiles

Versions of packages used:
create-cycle-app version: 5.0.0

@jonirrings
Copy link

for "leave page blank"

const init$: Stream<string> = sources.router.history$
        .take(1)
        .map(({ pathname }: Location) =>
            pathname === '/' ? '/yourInitialRoute' : pathname
        );

@jvanbruegge
Copy link
Collaborator

Found the issue, waiting for a new release now

@wmaurer
Copy link

wmaurer commented Jan 9, 2019

I ran create-cycle-app today, and am also experiencing webpack-dev-server live reload not working.
I also tried removing references to the router, i.e. I changed the App to:

export interface State extends CounterState {}
export function App(sources: Sources<State>): Sinks<State> {
    return Counter(sources)
}

Is the issue somewhere else, not in the router?

@cortopy
Copy link
Author

cortopy commented Jan 9, 2019

I've recently configured an app to use cycle and HMR, and there's something I don't undersand about create-cycle-app.

Webpack is configured with HMR but there is nothing I can see that manages it. The only module I've found for this is cycle-restart, but, unlike other HMR packages out there, it doesn't modify modules at compile time to make them react to hot reloads.

In my own setup I have two files:

  • app.dev.ts which looks very similar to the example in cycle-restart README file. This is my entry file in webpack.dev.ts
  • app.ts is the same without any reference to cycle-restart and the entry in webpack.prod.ts

The reason for this split is that I don't want cycle-restart in production builds.

@jvanbruegge does the router fix solve the same issue? or would this be a good PR for create-react-app?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants