question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HMR not working with PostHTML Modules

See original GitHub issue

🐛 bug report

When using PostHTML Modules for templating, modifying a partial html file doesn’t trigger HMR as it should.

🎛 Configuration (.babelrc, package.json, cli command)

My .posthtmlrc file:

{
  "plugins": {
    "posthtml-modules": {
      "root": "./web"
    },
    "posthtml-expressions": {
      "root": "./web"
    }
  }
}

and my package.json’s devDependencies:

"devDependencies": {
  "@babel/core": "^7.5.4",
  "mocha": "^6.1.4",
  "parcel-bundler": "^1.12.3",
  "posthtml-expressions": "^1.1.1",
  "posthtml-modules": "^0.4.2",
  "sass": "^1.22.3"
}

🤔 Expected Behavior

Editing a partial html file included as a PostHTML module should trigger HMR.

😯 Current Behavior

Nothing happens when the partial html file is edited.

💁 Possible Solution

Maybe Parcel isn’t following PostHTML modules’ paths or something? I’m not sure.

🔦 Context

Just trying to utilize HMR when developing - it makes my life easier.

💻 Code Sample

https://github.com/w-biggs/1212 is the repo; https://github.com/w-biggs/1212/blob/master/web/index.html is the entry HTML file.

🌍 Your Environment

Software Version(s)
Parcel 1.12.3
posthtml-modules 0.4.2
Node 11.14.0
npm/Yarn 6.9.2
Operating System Ubuntu 18.04.1 LTS (WSL)

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:14
  • Comments:11

github_iconTop GitHub Comments

5reactions
StraightOuttaCromptoncommented, Sep 10, 2020

Why has this been marked as closed? Seems like the issue hasn’t been fixed.

4reactions
BigPackiecommented, Dec 6, 2021

I’ve enjoyed using parcel but huge issues like these that does not get addressed definitely leave a bitter taste in my mouth. I see more issues related to problems with hot reloading. I really want this project to be successful. I’ve also contributed to the documentation, and It was my first contribution to a public project such as parcel.

HMR should be prioritized more as it is a key feature of parcel for developers. It gets very frustrating to manual restart/rebuild the project from time to time because the HMR did not kick in.

Read more comments on GitHub >

github_iconTop Results From Across the Web

css-loader | webpack - JS.ORG
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >
parcel - npm
Automatically transforms modules using Babel, PostCSS, and PostHTML when needed - even node_modules . ✂️ Zero configuration code splitting ...
Read more >
Webpack HMR not reloading HTML file - Stack Overflow
Problem is that html-webpack-plugin doesn't react to change and doesn't trigger the hmr. In order to achieve that you could try something ...
Read more >
@parcel/transformer-posthtml | Yarn - Package Manager
Fixes issues with ::-webkit-scrollbar , list styles in CSS modules, @-moz-document , and more. See release notes. Update SWC. Fixes an issue with...
Read more >
Parcel - Breword 文档集合
PostHTML is a tool for transforming HTML with plugins. ... Furthermore, modules do not reload with HMR, unless you modify the file where...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found