react-static: Hot reloading not working as expected with markdown template example.

Are you reporting a bug?

Yes

Hot reloading not working as expected with markdown template example.

https://github.com/nozzle/react-static/tree/master/examples/markdown

Environment

  1. react-static -v: 5.9.3
  2. node -v: v10.1.0
  3. yarn --version or npm -v: 6.0.1
  4. Operating system: Arch Linux

Steps to Reproduce the problem

  1. Install markdown template example
  2. Navigate to your new project
  3. Start the dev server
  4. Open http://localhost:3000 in browser
  5. Make an edit to src/App.js hot reloading works
  6. Make an edit to content/about.md hot reloading doesn’t work

Expected Behavior

Hot reloading should work for markdown content

The static.config.js should be watching the markdown content and running reloadRoutes

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 3
  • Comments: 20 (5 by maintainers)

Commits related to this issue

Most upvoted comments

Hot reloading has been revamped in v6 (currently beta). This should be fixed now.

I managed to fix it. I think the problem is with .babelrc merging… My .babelrc had the antdesign plugin:

{
  "extends": "react-static/.babelrc",
  "plugins": [
    [
      "import",
      {
        "libraryName": "antd",
        "style": true
      }
    ],
  ]
}

Hot reload is working after I changed it to

  "plugins": [
    "react-hot-loader/babel",
    [
      "import",
      {
        "libraryName": "antd",
        "style": true
      }
    ],
    ...

v5.8.6 - the reload works. v5.8.8 - does not work v5.9.1 - does not work v5.9.2 - does not work v5.9.3 - does not work

An update signal comes from the server. But the page is not updated.

@threebasicparts @happypeter do either of you have “react-hot-loader/babel” included in your .babelrc file?

{ "extends": "react-static/.babelrc", "plugins": ["react-hot-loader/babel"] }