You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Using redux in background.ts because the related dependency package references window. #401
Hi, using redux in background.ts, I found the problem as shown above, because the related dependency package references window (there is no window in Service Worker)
For example, the situation is that a custom axios is introduced in the createAsyncThunk method, and the axios wrapper internally introduces antd's message component to handle some generic error alerts. Currently it works fine after I clear the message component code.
Also tell us, what did you expect to happen?
This is probably not a bug, more like an optimization。
Is there any suggestion to avoid this problem, and is it possible to consider a package build of background.ts that excludes window related code.
Version
Latest
What OS are you seeing the problem on?
No response
What browsers are you seeing the problem on?
No response
Relevant log output
var webpackHMR = false;functionuseDevHMR() {
return webpackHMR;
}
exports.default = useDevHMR; // Webpack `module.hot.accept`do not support any deps update trigger
// We have to hack handler to force mark as HRM
if (module && module.hot) {
var win = window;if (typeof win.webpackHotUpdate === "function") {
var originWebpackHotUpdate = win.webpackHotUpdate;
win.webpackHotUpdate = function() {
webpackHMR = true;setTimeout(function() {
webpackHMR = false;
}, 0);
return originWebpackHotUpdate.apply(void 0, arguments);
};
}
}
},{"@parcel/transformer-js/src/esmodule-helpers.js":"hCtEe"}],
changed the title [-][BUG] The dependency causes the plugin to fail to run related to[/-][+][BUG] Using redux in background.ts because the related dependency package references window.[/+]on Jan 14, 2023
Activity
[-][BUG] The dependency causes the plugin to fail to run related to[/-][+][BUG] Using redux in background.ts because the related dependency package references window.[/+]