Webpack optimize CanvasTest error
See original GitHub issueHi, first thanks for your work.
I just tried it, and if I specify in webpack.config.js :
module.exports = {
optimization: {
minimize: true,
minimizer: [new TerserPlugin(),
},
...
This error is thrown :
Uncaught ReferenceError: canvasTest is not defined
at onmessage (d6ce07e3-5a07-454b-9558-b3c8698cbe7a:4)
I just test this code :
canvasSize.maxArea({
usePromise: true,
useWorker : true,
})
.then(({ width, height, benchmark }) => {
console.log(`Success: ${width} x ${height} (${benchmark} ms)`);
})
.catch(({ width, height, benchmark }) => {
console.log(`Error: ${width} x ${height} (${benchmark} ms)`);
});
Did I miss something ?
Best regards
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Optimization - webpack
Use the optimization.emitOnErrors to emit assets whenever there are errors while compiling. This ensures that erroring assets are emitted. Critical errors are ...
Read more >Webpack build error - Stack Overflow
I'm using exactly the same plugins on my webpack production config as you, and I'm quite sure that the reason is one of...
Read more >runtime error when use webpack 5 with optimization ... - GitHub
Reproduction simple demo use webpack 5 and esbuild-webpack-plugin git clone https://github.com/diem98/webpack5-esbuild-demo.git git checkout ...
Read more >Flaky WebGL Conformance Test: drawingbuffer-static-canvas ...
conformance/canvas/drawingbuffer-static-canvas-test.html (16 of 17 passed) failed: gl. ... I'll submit a bug for this and provide a patch for webkit.
Read more >Webpack + React Optimised from scratch | Nerd For Tech
Now are ready with our basic setup now and I can't wait to watch it running. > npm run dev. ERROR in main...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey again, @nicoja.
Fixed in 1.2.1.
Turned out to be an issue with Terser’s
mangle
option. Disabling this option or reserving thecanvasTest
name in the Terser config resolves the issue. If you’re still having issues, let me know.Thanks!
Very interesting. Also, very confusing.
The reason I didn’t se the issue is because I hadn’t tested using Chrome on the desktop. Instead, I tested everything but that: using Safari on the desktop, using Chrome in headless mode via automated tests, and with sample code on codesandbox.io. 🤦
Looks like I’ll need to dive into this a bit more. Thanks for your patience!