-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
2.7.1 is causing a terser issue in my applications #211
Comments
Hey @heath-freenome,
And unfortunately I am unable to reproduce on my end. I am also not sure it is related to wretch at all since the latest update was pretty innocuous. // index.js
import wretch from "wretch";
const api = wretch("https://jsonplaceholder.typicode.com");
api.get("/posts").json().then(console.log);
const headers1 = new Headers({ hello: "world" });
const headers2 = new Headers({ bonjour: "le monde" });
const headers3 = { hola: "mundo " };
const headers4 = [["hallo", "welt"]];
let w = wretch().headers(headers1);
console.log(w._options.headers);
// Object { hello: "world" }
w = w.headers(headers2);
console.log(w._options.headers);
// Object { hello: "world", bonjour: "le monde" }
w = w.headers(headers3);
console.log(w._options.headers);
// Object { hello: "world", bonjour: "le monde", hola: "mundo " }
w = w.headers(headers4);
console.log(w._options.headers);
// Object { hello: "world", bonjour: "le monde", hola: "mundo ", hallo: "welt" } {
"scripts": {
"start": "webpack --mode development",
"build": "webpack --mode production --config webpack.config.js"
},
"dependencies": {
"wretch": "^2.7.1"
},
"devDependencies": {
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4"
}
} // webpack.config.js
const TerserPlugin = require("terser-webpack-plugin");
module.exports = {
optimization: {
minimize: true,
minimizer: [new TerserPlugin()],
},
}; npm run build
> build
> webpack --mode production --config webpack.config.js
asset main.js 4.82 KiB [emitted] [minimized] (name: main)
orphan modules 14.1 KiB [orphan] 7 modules
./src/index.js + 7 modules 14.8 KiB [built] [code generated]
webpack 5.89.0 compiled successfully in 209 ms |
@heath-freenome No it was just a timeout during the build - nothing related to a terser error. |
Nothing to add here other than to say we are experiencing the same thing (webpack 4 build failure with same message)after adding [email protected], after reading this thread and rolling back to 2.7.0 we are able to build again. Build error resurfaces when we bump to [email protected] 🤔 |
I tested a bit and AFAIK the bug arises when using an outdated version of If you are using webpack 4, you can install V4 of the plugin ( const path = require('path');
const TerserPlugin = require("terser-webpack-plugin");
module.exports = {
entry: './src/index.mjs',
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist'),
},
optimization: {
minimize: true,
minimizer: [new TerserPlugin()],
},
}; |
I can confirm that upgrading to |
When I bumped my applications to use
2.7.1
I started having my webpack builds fail with the following error:I'm not sure whether it was your bug fix or the two library updates. I'm not sure how to give you a reproducible example
The text was updated successfully, but these errors were encountered: