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

TypeError: Cannot read property 'call' of undefined #9258

Closed
JohanBeumer opened this issue Jun 12, 2019 · 9 comments
Closed

TypeError: Cannot read property 'call' of undefined #9258

JohanBeumer opened this issue Jun 12, 2019 · 9 comments

Comments

@JohanBeumer
Copy link

JohanBeumer commented Jun 12, 2019

Bug report

What is the current behavior?
When using a custom webpack config the classname should not be mangled. Right now I'm getting the console error as shown below.

If the current behavior is a bug, please provide the steps to reproduce.
The problem can be reproduced using this repo. When you build the project with
ng build --prod --aot
and then open the page it shows this error :

runtime-es2015.29bb7a5678a9e1bc4d05.js:1 Uncaught TypeError: Cannot read property 'call' of undefined
    at f (runtime-es2015.29bb7a5678a9e1bc4d05.js:1)
    at Object.1 (polyfills-es2015.8f5c586921f6179cdfaf.js:1)
    at f (runtime-es2015.29bb7a5678a9e1bc4d05.js:1)
    at e (runtime-es2015.29bb7a5678a9e1bc4d05.js:1)
    at Array.r [as push] (runtime-es2015.29bb7a5678a9e1bc4d05.js:1)
    at polyfills-es2015.8f5c586921f6179cdfaf.js:1
f @ runtime-es2015.29bb7a5678a9e1bc4d05.js:1
1 @ polyfills-es2015.8f5c586921f6179cdfaf.js:1
f @ runtime-es2015.29bb7a5678a9e1bc4d05.js:1
e @ runtime-es2015.29bb7a5678a9e1bc4d05.js:1
r @ runtime-es2015.29bb7a5678a9e1bc4d05.js:1
(anonymous) @ polyfills-es2015.8f5c586921f6179cdfaf.js:1

What is the expected behavior?
I expect the page to show the name of the class like this : Classname is Foo

Other relevant information:
webpack version: 4.33.0
Node.js version: 11.12.0
Operating System: Windows 10 pro
Google chrome Version 75.0.3770.80 (Official Build) (64-bit)

@sokra
Copy link
Member

sokra commented Jun 12, 2019

Which steps did you try to find the problem?

@JohanBeumer
Copy link
Author

I build the project with "ng build --prod --aot".
I guess you have to setup a local server with the "dist\shiney-ivy-app" as the documentroot.
If you then open index.html you should get the error.

@sokra
Copy link
Member

sokra commented Jun 12, 2019

It would be great if you reduce your issue to a small reproducible example.

@JohanBeumer
Copy link
Author

The project is what you get with ng new
I'm not sure if it can get much smaller if that's what you mean.

I actually didn't try it as I thought it didn't work, but you can also reproduce the issue when you start the project with :
ng serve --prod --aot

That doesn't give you the console error, but it does show a mangled classname. So it looks like
ng serve --prod --aot and ng build --prod --aot give a different result.

The mangled classname is what I tried to prevent in the first place. But no matter what I tried in the custom webpack config I didn't get that working.

@perevezencev
Copy link

The same problem occurred yesterday

@lacolaco
Copy link

@JohanBeumer could you paste your ng version command result in the project?

@JohanBeumer
Copy link
Author

That is :

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 8.0.2
Node: 11.12.0
OS: win32 x64
Angular: 8.0.0
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.800.2
@angular-devkit/build-angular     0.800.2
@angular-devkit/build-optimizer   0.800.2
@angular-devkit/build-webpack     0.800.2
@angular-devkit/core              8.0.2
@angular-devkit/schematics        8.0.2
@angular/cli                      8.0.2
@ngtools/webpack                  8.0.2
@schematics/angular               8.0.2
@schematics/update                0.800.2
rxjs                              6.4.0
typescript                        3.4.5
webpack                           4.33.0

@filipesilva
Copy link
Contributor

I don't think this is related to Webpack. Can you open this issue on https://github.com/angular/angular-cli please?

@DanielRuf
Copy link
Contributor

We should close this as this does not seem to be a webpack issue as described at angular/angular-cli#14779 (comment)

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

7 participants