Skip to content
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

options is required for 3.4.0 #300

Closed
crixusshen opened this issue Jul 30, 2019 · 5 comments · Fixed by #302
Closed

options is required for 3.4.0 #300

crixusshen opened this issue Jul 30, 2019 · 5 comments · Fixed by #302

Comments

@crixusshen
Copy link

in the new 3.4.0,I found options of new BundleAnalyzerPlugin(options?: object) that it become required, otherwise it will get an error: Cannot use 'in' operator to search for 'analyzerPort' in undefined. if using the new BundleAnalyzerPlugin({}) in this way is successful.Is there a problem with 3.4.0?

@valscion
Copy link
Member

Thanks, this seems like a regression caused by #290

We'll get a fix out shortly

@valscion
Copy link
Member

Fixed in v3.4.1

@avin-kavish
Copy link
Contributor

avin-kavish commented Jul 30, 2019

2 years working with javascript and never knew the in operator didn't work on undefined. All the tests passed too. Will passing nulls break it too, if so is that a case we need to accommodate?

@valscion
Copy link
Member

valscion commented Jul 30, 2019

Passing null as options has never been supported.

EDIT: Looks like {...null} does evaluate to an empty object. However, the documented API never mentioned that it would be OK to pass null to the constructor, so maybe checking null there would be unnecessary.

@valscion valscion unpinned this issue Jul 30, 2019
@th0r
Copy link
Collaborator

th0r commented Jul 30, 2019

Passing null as options has never been supported.

Yes, we shouldn't cover this case - it's a user's responsibility to provide parameter with proper type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants