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

Fatal error after updating to 2.61.0 #66

Closed
ralexandr opened this issue Sep 25, 2021 · 6 comments
Closed

Fatal error after updating to 2.61.0 #66

ralexandr opened this issue Sep 25, 2021 · 6 comments
Labels

Comments

@ralexandr
Copy link

After updating to 2.61.0 i receive such error. But only on production build, in dev-env everything is fine

Uncaught TypeError: Object.defineProperty called on non-object at Function.defineProperty (<anonymous>) at exports (index.js:3) at index.js:11

index.js:11 means awesome-phonenumber/index.js:11

It seams that it could be related to #65

@grantila
Copy link
Owner

Do you have a longer stacktrace and some setup I can use? I guess this is some webpack or other system. I have a possible fix, please check 2.62.0

@github-actions
Copy link

🎉 This issue has been resolved in version 2.62.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ralexandr
Copy link
Author

Now i receive another error, version 2.62.0
Bundler: vitejs

Uncaught TypeError: Object.defineProperty called on non-object at Function.defineProperty (<anonymous>) at vendor.f6cdc250.js:sourcemap:138 at vendor.f6cdc250.js:sourcemap:138

CleanShot 2021-09-25 at 19 15 20

@ralexandr
Copy link
Author

I may think that the issue is caused by vitejs, but it hasn't been upgraded and/or it's config hasn't been changed
Also, with version 2.58.0 everything works fine.
What kind of changes has been made in 2.59.0 version that can cause such problem?

@grantila
Copy link
Owner

Between 2.58 and 2.59 nothing happened except bumping libphonenumber with a patch number. Not sure if something have happened there.

The build used to use a really old closure compiler but is now using the latest, and in 2.62 I disabled the closure compiler from rewriting es6 features, like e.g. Object.defineProperty, so now it uses whatever the system uses.

I've never used vitejs, but searching its issues I found this: vitejs/vite#162 which mentions CommonJS packages as more or less not being supported. If that's the case, it'll be really hard to use closure-compiled code with vitejs.

I think, since this works great in Node, it's a vitejs issue, open up an issue there and see. Not being able to use Object.defineProperty on a Function is clearly a violation and an invalid implementation of defineProperty.

@grantila
Copy link
Owner

This is fixed in 2.63.0

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

No branches or pull requests

2 participants