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

Problems since 1.0.30001561 release #122

Closed
fhickeyipu opened this issue Nov 17, 2023 · 2 comments
Closed

Problems since 1.0.30001561 release #122

fhickeyipu opened this issue Nov 17, 2023 · 2 comments

Comments

@fhickeyipu
Copy link

Our React app started having problems mysteriously. No problems running locally with yarn start. The production build would complete successfully, but while running the app we get strange errors about things being undefined or used before initialization. It seems like somehow, caniuse-lite 1.0.30001561 is causing changes in the resulting code of our production builds.

For example, with 1.0.30001559, here is what a particular function looks like at run time:

image

This is from react-onclickoutside code, not ours. In the image above, you should see that handleClickOutside looks like a regular function with a prototype and constructor.

With the only change being caniuse-lite 1.0.30001561 instead of 1.0.30001559, the same function looks like this at run time:

image

In this version, handleClickOutside is represented as an arrow function and there is no prototype. This ends up resulting in errors like this:

image

At first, we thought the problem was with react-onclickoutside, but other parts of our app are also getting strange errors and I was able to narrow down that the issues started with the release of caniuse-lite 1.0.30001561. Is anybody else having issues like this?

@ai
Copy link
Member

ai commented Nov 17, 2023

Very likely that the problem is coming from polyfills.

camiuse-lite updates changes target browsers in Browserslist queries like last 2 versions. It changes what polyfills will be added by Babel.

On many boilerplates there are different target browsers for production and development.

I suggest running npx browserslist before and after update to check browsers difference and then create a solid policy about target browsers.

@ai ai closed this as completed Nov 17, 2023
@ai
Copy link
Member

ai commented Nov 17, 2023

I am closing this issue since stacktrace doesn’t have browserslist or camiuse-lite and environment debugging is a commercial work and not a community help.

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

No branches or pull requests

2 participants