-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[2.0 alpha 3.2]TypeError: module.hot is undefined #4063
Labels
Comments
Minimal Reproduction: // a.js
import React from "react";
import C from "./c";
function A() {
return (
<div>
A
<C />
</div>
);
}
export default A; // b.js
import React from "react";
import C from "./c";
function B() {
return (
<div>
B
<C />
</div>
);
}
export default B; // c.js
import React from "react";
function C() {
return "Common";
}
export default C; // index.js
import React, { Suspense, lazy } from "react";
import ReactDOM from "react-dom";
let A = lazy(() => import("./a"));
let B = lazy(() => import("./b"));
export default function App(props) {
return (
<Suspense fallback={<p>Loading...</p>}>
<A />
</Suspense>
);
}
ReactDOM.render(<App />, document.getElementById("root")); |
The HMR runtime isn't executed in the async bundle. // index.js
import React from "react";
let A = () => import("./a");
let B = () => import("./b");
console.log(A().then(v => v.default));
// a.js
import React from "react";
import C from "./c";
console.log("A", module.hot);
export default "A" + C;
// b.js
import React from "react";
import C from "./c";
console.log("B", module.hot);
export default "B" + C;
// c.js
import React from "react";
console.log("C", module.hot); // undefined
export default "C"; |
@mischnic is this by design or am I doing async bundling wrong? |
No, this is a bug. |
DeMoorJasper
pushed a commit
that referenced
this issue
Mar 14, 2020
Related to #4063, This is crashing my app currently, which is async loading a few components.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🐛 bug report
💻 Code Sample
Reproducible repo: https://github.com/andriijas/parcel-hmr-error
🤔 Expected Behavior
Expect async routes to navigate
😯 Current Behavior
Try open http://localhost:1234/dashboard in browser and then navigate to Foo or Bar in the header navigation
🌍 Your Environment
🖼 Screenshot
The text was updated successfully, but these errors were encountered: