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
If the call to wasm-pack build fails, yarn (which runs webpack --mode production) still returns an error code of 0. I traced the problem to this bit of code:
compiler.hooks.thisCompilation.tap('WasmPackPlugin',(compilation)=>{// Super hacky, needed to workaround a bug in Webpack which causes// thisCompilation to be triggered twice on the first compilation.if(first){first=false;}else{// This is needed in order to gracefully handle errors in Webpack,// since Webpack has its own custom error system.if(this.error!=null){compilation.errors.push(this.error);}}});
Since first is true (at least in the cases I tested), the else branch never triggers, and so no error is reported back to webpack. By moving the
Possibly related: if I use Webpack to build both the WASM and some TypeScript that depends on this WASM, then compilation of the TypeScript code proceeds even if compiling the Rust code failed (and might also subsequently fail if the bindings' API changed).
Edit: probably unrelated, because the PR by @nanaian above doesn't fix it. #47 is probably closer to what I was talking about.
If the call to
wasm-pack build
fails,yarn
(which runswebpack --mode production
) still returns an error code of0
. I traced the problem to this bit of code:Since
first
is true (at least in the cases I tested), theelse
branch never triggers, and so no error is reported back to webpack. By moving thebit into the
if
branch, I got the behavior I expected; i.e. the output from yarn isinstead of
The text was updated successfully, but these errors were encountered: