-
Notifications
You must be signed in to change notification settings - Fork 12k
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
TypeError: Cannot read property 'call' of undefined #14779
Comments
Heya, indeed it's not a webpack issue. It's happens because we mangle class names on our minification step. That is intended behaviour. #6454 (comment) explains the problem, and alternative approaches. #5883 was also a similar problem. |
@filipesilva I added a static property to the class and use that, as is suggested in #6454. With that adjustment in place However build the app with
I updated all dependencies in my sample repo the latest versions.
Can you please take a look at this issue again and reopen it if appropriate? I also have a question about the TerserOptions. The documentation says : Based on this I would expect my classname/functionname not to be mangled. But this conflicts the comment in #6454. Am I making a thinking mistake here? |
Terser indeed has that option. But we do not use it or expose it. If you wish to configure Terser with custom options, we suggest using something like https://github.com/manfredsteyer/ngx-build-plus. I tried to reproduce the
Then to serve I used http-server by installing it globally and running I see |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🐞 Bug report
Command (mark with an
x
)Is this a regression?
Yes, the previous version in which this bug was not present was: ....I don't know what version it was, but when uglifyjs instead of terser was used it worked
Description
A clear and concise description of the problem...The problem I have is that when I use a custom webpack.config in an attempt to prevent certain keywords (classnames in my case) from being mangled it does not work and still mangles the classname. This happens when I start the app with
ng serve --prod --aot
I expect the page to show :
But in my case it shows :
When I build the app with
ng build --prod --aot
and then start the app I get the error as shown by "Exception or Error".🔬 Minimal Reproduction
You can reproduce the issue by cloning this repo and use any of these commands :
🔥 Exception or Error
Running the result of
ng build --prod --aot
gives this error :🌍 Your Environment
Anything else relevant?
Don't now if it's browser specific. I'm getting it in Google chrome version 75.0.3770.90 (Official Build) (64-bit)
I created an issue with webpack, but I got asked by @filipesilva to create the issue with angular-cli.
The text was updated successfully, but these errors were encountered: