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
regression due #15899 #16097
Comments
This issue had no activity for at least three months. It's subject to automatic issue closing if there is no activity in the next 15 days. |
bump |
Issue was closed because of inactivity. If you think this is still a valid issue, please file a new issue with additional information. |
I'm not sure if this is the same issue yet, but something completely broke @home-assistant frontend from 5.72.1 to 5.73.0. The app now just completely hangs - no webpack errors or warnings and nothing in the console either. @jsg2021 you mentioned in the PR that you were able to work around the problem. How? |
In my example repo, it's importing a module that uses a top-level await... i factored that module out of my graph. I can't remember if i got rid of it, or marked it external. It's been a while. |
Ah okay. Thanks anyway. |
@alecmev you had mentioned having a similar issue. Were you ever able to figure it out? |
@steverep Nope, still pinned to |
I was able to better characterize the issue (at least in my case). It seems the entry bundle is no longer being recognized as JS:
This doesn't show in the console when the code is wrapped in @alexander-akait any idea what is the root cause here? |
@steverep That suggests it's a different issue. In my case the file is served...it just never calls back to the module graph to finish bootstrapping. (the top-level await) In your case...What is serving the files? refusing to serve the file would be a bug in the web service configuration, but the output files's mine type (i don't think) is not handled by webpack ?? most systems map mime type by file extension. some file systems can set it as metadata on the file. |
@jsg2021 sorry my comment wasn't very clear. The entry chunk actually does begin to load, so that error is caused by the webpack runtime trying to load an async chunk somewhere. |
Just following up on my previous comments.. The type In short, loading the entrypoint either with I've been through the diffs between 5.72.1 and 5.73.0 multiple times and #15899 seems like the only viable one to blame (and also the one I understand the least 😕). |
I believe I know partially what is happening here, just ran into this issue myself. It seems that if you have a module that does top-level await conditionally, then the module chain won't finish loading. Please see this repo for a minimal reproducible example along with basic debug I did to confirm it, pasted below for reference: Some debugging I did with my free time into this issue (see the code above for context for this to make sense): The forced CASE 1: > (async () => { console.log('test 1'); })(); console.log('test 2');
test 1
test 2 CASE 2: > (async () => { await 'test'; console.log('test 1'); })(); console.log('test 2');
test 2
test 1 The await causes the statement outside the async function to run first. Using a dummy From deep-dive into webpack, it appears that it is setting /***/ 795:
/***/ ((module, __unused_webpack___webpack_exports__, __webpack_require__) => {
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
// Comment out line 2 and uncomment line 3 to get fixed/expected behavior.
__webpack_require__.g.someNonExistentVariable && await 'test';
// await 'test';
console.log('here 2');
__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } }, 1); // <--- THIS `1` RIGHT HERE
/***/ }) Note the comment "THIS `1` RIGHT HERE" marking the code of interest. This This is the extent to which I debugged the issue to determine it is likely a webpack bug. |
I can confirm that conditional TLA is the problem. When I refactor to remove the conditionals from the @ConnorLanglois thanks for figuring this out 👏🏻 @alexander-akait maybe it's time to remove "possible" from the issue title? 😉 |
Yeah, feel free to send a fix if you want to help, also put this in our board |
Here you go:
https://github.com/jsg2021/webpak-hanging-bundle-example
Originally posted by @jsg2021 in #15899 (comment)
The text was updated successfully, but these errors were encountered: