-
Notifications
You must be signed in to change notification settings - Fork 12k
AoT ERROR in Cannot read property 'codeGen' of undefined #3682
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
Comments
looks like packages/@ngtools/webpack/src/plugin.ts from this commit is causing the problem becauase of the change to the appending onto the path. I'm reverting back to version [email protected] to see if that fixes the problem. |
@bmbrown10 I figured out a workaround from another user in the other issue I referenced above: Instead of downgrading to beta.21, pin cli's internal dependencies by adding "@ngtools/webpack": "1.1.9" to your package.json. Once I did that, the error went away and build/serves aot fine. I will update the original issue to suggest such a fix as well. |
@aaronleeucla it works for me also. But i installed @ngtools/webpack using |
could be related to #3714 (comment) |
I think we didn't pin |
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. |
OS?
OSX El Capitan, OSX Sierra, Amazon Linux on EC2
Versions.
beta.22 / angular 2.2.3
Repro steps.
I have a branch cut from a few weeks ago on the above versions.
Several days ago,
ng build --aot=true --target=production
works fine.Yesterday, same command fails (log below)
Keep in mind that this is via a build server on Jenkins, which checks out a clean copy every time. To replicate, I did a clean checkout of my repo in another directory, switch to the cut branch that hasn't been modified since our last sprint, and the same issue appears.
I was able to build fine on my local workspace repo, but once I deleted my cached node_module directory and re-installed all dependencies, I get the same error below.
The log given by the failure.
Hash: 298b4d5b0927ce483a6d Time: 18425ms chunk {0} scripts.2ec7b6c32f2cecb6ef43.bundle.js, scripts.2ec7b6c32f2cecb6ef43.bundle.map (scripts) 112 kB {4} [initial] [rendered] chunk {1} main.0ffb0f0b246299e375b6.bundle.js, main.0ffb0f0b246299e375b6.bundle.map (main) 2.02 kB {3} [initial] [rendered] chunk {2} styles.b2328beb0372c051d06d.bundle.js, styles.fc27ae193c6cf276eb76015a2f77056b.bundle.css, styles.b2328beb0372c051d06d.bundle.map, styles.b2328beb0372c051d06d.bundle.map (styles) 69 bytes {4} [initial] [rendered] chunk {3} vendor.0c6af147dfcf8a75bb37.bundle.js, vendor.0c6af147dfcf8a75bb37.bundle.map (vendor) 855 kB [initial] [rendered] chunk {4} inline.d41d8cd98f00b204e980.bundle.js, inline.d41d8cd98f00b204e980.bundle.map (inline) 0 bytes [entry] [rendered]
ERROR in Cannot read property 'codeGen' of undefined
ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/Users/aaron/repos/my-clean-checkout/src' @ ./src/main.ts 4:0-74 @ multi main
ERROR in ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js Module not found: Error: Can't resolve '/Users/aaron/repos/my-clean-checkout/src/$$_gendir' in '/Users/aaron/repos/my-clean-checkout/node_modules/@angular/core/src/linker' @ ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js 46:15-36 58:15-102 @ ./~/@angular/core/src/linker.js @ ./~/@angular/core/src/core.js @ ./~/@angular/core/index.js @ ./src/main.ts @ multi main
Mention any other details that might be useful.
I suspect some breaking bug might have been published to beta.22, angular 2.2.3, or one of its dependencies. NPM is fetching the same version from the public repo as before, but getting a bad version now.
Upgrading to beta.24 / angular 2.3.0+ may not be a feasible solution since I use a few libraries that hasn't been exported to be AoT compatible for 2.3.0+, but instead still works for 2.2.3. If I were to upgrade, I get the error reported at #3674
##UPDATE the internal dependency in question appears to be "@ngtools/webpack". Perhaps the solution is to pin beta.22's ngtools/webpack to version 1.1.9, instead of specifying the latest minor/patch version, which resolves to 1.2.1 according to npmjs
The text was updated successfully, but these errors were encountered: