Skip to content

1.3.0-rc.1 ng build --prod fails on a project that builds fine with 1.2.5. #7161

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

Closed
justingrayston opened this issue Jul 27, 2017 · 5 comments

Comments

@justingrayston
Copy link
Contributor

justingrayston commented Jul 27, 2017

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

Output from: ng --version 1.3.0-rc.1
node: v8.2.1 npm: 5.3.0 yarn: 0.27.5
macOS Sierra

Repro steps.

After upgrading to 1.3.0-rc.1 to try it out the build of the app fails.

First build with 1.2.5 works fine.

ng build --prod

Your global Angular CLI version (1.3.0-rc.1) is greater than your local
version (1.2.5). The local Angular CLI version is used.

To disable this warning use "ng set --global warnings.versionMismatch=false".
Hash: d16954f404c42ba5732c
Time: 38734ms
chunk    {0} polyfills.91322ee5cfa1770ac059.bundle.js (polyfills) 460 kB {6} [initial] [rendered]
chunk    {1} main.9cdea9b8c39c51262389.bundle.js (main) 335 kB {5} [initial] [rendered]
chunk    {2} scripts.338005a283f97e7fb376.bundle.js (scripts) 224 kB {6} [initial] [rendered]
chunk    {3} styles.8f086aa8a1dece57b987.bundle.css (styles) 122 bytes {6} [initial] [rendered]
chunk    {4} sw-register.353dfbaf348c09b10717.bundle.js (sw-register) 232 bytes {6} [initial] [rendered]
chunk    {5} vendor.8fa1c41ca62260448872.bundle.js (vendor) 2.82 MB [initial] [rendered]
chunk    {6} inline.dfadc198c867d27a8736.bundle.js (inline) 0 bytes [entry] [rendered]

Upgrade cli.

yarn upgrade @angular/[email protected]

Build again.

ng build --prod

Justin-MacBook-Pro:web-app justingrayston$ ng build --prod
 12% building modules 21/23 modules 2 active ...ycle/website/web-app/src/polyfills.tsThe final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string
Date: 2017-07-27T09:25:55.964Z
Hash: 7a55c7c9fa16274ee9aa
Time: 14987ms
chunk {0} polyfills.283b7bcb563ad2d3a609.bundle.js (polyfills) 182 kB {6} [initial] [rendered]
chunk {1} scripts.dfbb2753ca59db90374e.bundle.js (scripts) 219 kB {6} [initial] [rendered]
chunk {2} styles.8f086aa8a1dece57b987.bundle.css (styles) 28.7 kB {6} [initial] [rendered]
chunk {3} main.000998479980b5260bcb.bundle.js (main) 411 bytes {5} [initial] [rendered]
chunk {4} sw-register.578191a768488978f564.bundle.js (sw-register) 241 bytes {6} [initial] [rendered]
chunk {5} vendor.82632e37aed7fca1bbb2.bundle.js (vendor) 210 kB [initial] [rendered]
chunk {6} inline.83097302650c06ad17f7.bundle.js (inline) 1.5 kB [entry] [rendered]


ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/Users/justingrayston/Documents/workspace/angular/website/web-app/src'
resolve './$$_gendir/app/app.module.ngfactory' in '/Users/justingrayston/Documents/workspace/angular/website/web-app/src'
  using description file: /Users/justingrayston/Documents/workspace/angular/website/web-app/package.json (relative path: ./src)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: /Users/justingrayston/Documents/workspace/angular/website/web-app/package.json (relative path: ./src)
    using description file: /Users/justingrayston/Documents/workspace/angular/website/web-app/package.json (relative path: ./src/$$_gendir/app/app.module.ngfactory)
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        /Users/justingrayston/Documents/workspace/angular/website/web-app/src/$$_gendir/app/app.module.ngfactory doesn't exist
      .ts
        Field 'browser' doesn't contain a valid alias configuration
        /Users/justingrayston/Documents/workspace/angular/website/web-app/src/$$_gendir/app/app.module.ngfactory.ts doesn't exist
      .js
        Field 'browser' doesn't contain a valid alias configuration
        /Users/justingrayston/Documents/workspace/angular/website/web-app/src/$$_gendir/app/app.module.ngfactory.js doesn't exist
      as directory
        /Users/justingrayston/Documents/workspace/angular/website/web-app/src/$$_gendir/app/app.module.ngfactory doesn't exist
[/Users/justingrayston/Documents/workspace/angular/website/web-app/src/$$_gendir/app/app.module.ngfactory]
[/Users/justingrayston/Documents/workspace/angular/website/web-app/src/$$_gendir/app/app.module.ngfactory.ts]
[/Users/justingrayston/Documents/workspace/angular/website/web-app/src/$$_gendir/app/app.module.ngfactory.js]
[/Users/justingrayston/Documents/workspace/angular/website/web-app/src/$$_gendir/app/app.module.ngfactory]
 @ ./src/main.ts 3:0-74
 @ multi ./src/main.ts

Fails to build. Interestingly if I now roll back to 1.2.5 the failure persists.

yarn upgrade @angular/cli@latest

ng build --prod

Your global Angular CLI version (1.3.0-rc.1) is greater than your local
version (1.2.5). The local Angular CLI version is used.

To disable this warning use "ng set --global warnings.versionMismatch=false".
Hash: a24767bfeeffb77440b2
Time: 14241ms
chunk    {0} polyfills.91322ee5cfa1770ac059.bundle.js (polyfills) 460 kB {6} [initial] [rendered]
chunk    {1} scripts.f2152fae5c4689e1beb8.bundle.js (scripts) 224 kB {6} [initial] [rendered]
chunk    {2} main.be1e4408c4b853dbd6de.bundle.js (main) 1.17 kB {5} [initial] [rendered]
chunk    {3} styles.8f086aa8a1dece57b987.bundle.css (styles) 122 bytes {6} [initial] [rendered]
chunk    {4} sw-register.353dfbaf348c09b10717.bundle.js (sw-register) 232 bytes {6} [initial] [rendered]
chunk    {5} vendor.9c10786d46458667292c.bundle.js (vendor) 847 kB [initial] [rendered]
chunk    {6} inline.95e8520d1f28f7a4cb35.bundle.js (inline) 0 bytes [entry] [rendered]

ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/Users/justingrayston/Documents/workspace/angular/website/web-app/src'
 @ ./src/main.ts 3:0-74
 @ multi ./src/main.ts

Only changes are to package.json and yarn.lock that I'd expect. So I don't quite understand why the error now persists.

Just tested in a clean project.

ng new test-app

Then in that app run ng build --prod

 10% building modules 6/7 modules 1 active ...cle/website/test/test-app/src/main.tsThe final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string
Date: 2017-07-27T09:38:21.517Z
Hash: 81ce49994c138ace48ac
Time: 10147ms
chunk {0} polyfills.71b130084c52939ca448.bundle.js (polyfills) 62.6 kB {4} [initial] [rendered]
chunk {1} main.17af88c8e59171accd9c.bundle.js (main) 411 bytes {3} [initial] [rendered]
chunk {2} styles.d41d8cd98f00b204e980.bundle.css (styles) 0 bytes {4} [initial] [rendered]
chunk {3} vendor.e93448ebe795e24829a7.bundle.js (vendor) 210 kB [initial] [rendered]
chunk {4} inline.bbb63b81ed3d5a931020.bundle.js (inline) 1.45 kB [entry] [rendered]


ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/Users/justingrayston/Documents/workspace/angular/website/test/test-app/src'
resolve './$$_gendir/app/app.module.ngfactory' in '/Users/justingrayston/Documents/workspace/angular/website/test/test-app/src'
  using description file: /Users/justingrayston/Documents/workspace/angular/website/test/test-app/package.json (relative path: ./src)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: /Users/justingrayston/Documents/workspace/angular/website/test/test-app/package.json (relative path: ./src)
    using description file: /Users/justingrayston/Documents/workspace/angular/website/test/test-app/package.json (relative path: ./src/$$_gendir/app/app.module.ngfactory)
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        /Users/justingrayston/Documents/workspace/angular/website/test/test-app/src/$$_gendir/app/app.module.ngfactory doesn't exist
      .ts
        Field 'browser' doesn't contain a valid alias configuration
        /Users/justingrayston/Documents/workspace/angular/website/test/test-app/src/$$_gendir/app/app.module.ngfactory.ts doesn't exist
      .js
        Field 'browser' doesn't contain a valid alias configuration
        /Users/justingrayston/Documents/workspace/angular/website/test/test-app/src/$$_gendir/app/app.module.ngfactory.js doesn't exist
      as directory
        /Users/justingrayston/Documents/workspace/angular/website/test/test-app/src/$$_gendir/app/app.module.ngfactory doesn't exist
[/Users/justingrayston/Documents/workspace/angular/website/test/test-app/src/$$_gendir/app/app.module.ngfactory]
[/Users/justingrayston/Documents/workspace/angular/website/test/test-app/src/$$_gendir/app/app.module.ngfactory.ts]
[/Users/justingrayston/Documents/workspace/angular/website/test/test-app/src/$$_gendir/app/app.module.ngfactory.js]
[/Users/justingrayston/Documents/workspace/angular/website/test/test-app/src/$$_gendir/app/app.module.ngfactory]
 @ ./src/main.ts 3:0-74
 @ multi ./src/main.ts
@ghost
Copy link

ghost commented Jul 27, 2017

This is an ongoing known issue.

Issue discussion here: 7136

@justingrayston
Copy link
Contributor Author

But it builds ok in 1.2.5 (was 1.2.4). It only breaks after upgrading to 1.3.0-rc.1

I'll test it via npm instead, and close this issue if it does look to be the same. The output sure suggests it.

@justingrayston
Copy link
Contributor Author

Confirmed, building the 1.3.0-rc.1 generated app with npm instead of yarn works. Thanks @heypaulmcgrath

Closing.

@ghost
Copy link

ghost commented Jul 27, 2017

No problem :)

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant