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 }}
This repository has been archived by the owner on Sep 9, 2021. It is now read-only.
I have also run into this issue recently. In my case, I am trying to write 2 versions of a library (one has the main thread run expensive() directly, and the other has main posting runExpensive messages to a web worker).
I only managed to get around this by writing 2 separate files main.js (expensive() runs in-place) and worker.js (runExpensive message is posted to a webworker), and then using the nasty webpack.NormalModuleReplacementPlugin in my webpack config.
Instead of importing the module directly, my code was changed to something like import * as api from ./api/THREAD_TARGET and then...
newwebpack.NormalModuleReplacementPlugin(/THREAD_TARGET/,function(resource){// Imports occuring in a webworker should use main; otherwise worker. constcompiler=resource.contextInfo.compiler;constmainOk=(compiler&&compiler.startsWith("worker-loader"));if(mainOk){constnewRequest=resource.request.replace(/THREAD_TARGET/,"main");resource.request=newRequest;}else{constnewRequest=resource.request.replace(/THREAD_TARGET/,"worker");resource.request=newRequest;}})
I've got package A that depends on package B, which depends on package C (worker), which depends on package A.
I'm getting an error like this: http://trusktr.io:7777/ixujinuzij
This issue was moved from webpack/webpack#1564 by @evilebottnawi. Original issue was by @trusktr.
The text was updated successfully, but these errors were encountered: