-
-
Notifications
You must be signed in to change notification settings - Fork 227
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
Bundlephobia does not support modern language features. #530
Comments
I did some testing and have discovered that three aspects of my code were causing the build error. The "static" keyword: class Foo {
static bar = 0;
} class Foo {
#bar;
constructor() {
this.#bar = 0;
}
} Arrow function expression methods: class Foo {
bar = () => console.log('Hello, world!');
} All three are supported by the newest version of Terser. |
The package I linked in the original example has been renamed and changes were made within the code so that it would bundle correctly. It would still be nice for this to work for other packages, though. |
It seems like the nullish coalescing operator: const foo = (bar) => bar ?? 0; and optional chaining: foo?.bar?.(); also cause build errors. Both are also supported by the newest version of Terser. |
It was causing Bundlephobia build errors: pastelsky/bundlephobia#530
The issue comes from the Most recent PR: pastelsky/package-build-stats#35 |
Update on supporting modern language features:
All of this is going to take a month or so, given holidays and my work schedule. Apologies for not responding on the thread sooner, but I thought I'd share an update because it's not like I've not been thinking about this problem — its just a lot of work. |
Note: Bundlephobia should now support new javascript syntax — all that's supported by the latest version of Acorn and Terser — reasonably well, while I continue to work on replacing our bundler under the hood. This was long due — thanks a lot for all of your patience! |
See comments for further details. I have unpublished the packages that the original post mentioned.
No details are given in the error aside from "Failed to build this package."
The text was updated successfully, but these errors were encountered: