Skip to content

-prod build fails, repro. on blank (ng new) project: looking for .map files #888

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
sgbeal opened this issue May 23, 2016 · 27 comments
Closed
Assignees
Labels
needs: repro steps We cannot reproduce the issue with the information given type: bug/fix

Comments

@sgbeal
Copy link

sgbeal commented May 23, 2016

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

windows 10 and Linux (some RHEL variant - i haven't got login access to verify which)

  1. Versions. Please run ng --version. If there's nothing outputted, please
    run in a Terminal:
    node --version
    And paste the result here.

node versions 6.1.0, 5.10.1

ng 1.0.0-beta.1 and beta.5

    $ ./node_modules/angular-cli/bin/ng --version
    (node:11152) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
    angular-cli: 1.0.0-beta.5
    node: 6.1.0
    os: win32 x64
  1. Repro steps. Was this an app that wasn't created using the CLI? What change did you
    do on your code? etc.

    npm uninstall -g angular-cli
    npm install -g angular-cli
    ng new wth
    cd wth
    ng build -prod
    

also tested explicitly with versions 1.0.0-beta.1 and beta.5.

This is breaking our current project, where we distinguish between prod and dev builds (different functionality imported via environment.XXX.ts).

  1. The log given by the failure. Normally this include a stack trace and some
    more information.

        stephan@Curie MINGW64 /d/src/wth (master)
        $ ./node_modules/angular-cli/bin/ng build -prod
        (node:6152) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
        "{{content-for}}" has been deprecated and will be removed before RC.
        (node:6152) DeprecationWarning: 'root' is deprecated, use 'global'
        (node:6152) DeprecationWarning: 'GLOBAL' is deprecated, use 'global'
        Build failed.
        The Broccoli Plugin: [BundlePlugin] failed with:
        Error on fetch for main.js at file:///D:/src/wth/tmp/bundle_plugin-input_base_path-x2yQV9tU.tmp/0/main.js
                Error: ENOENT: no such file or directory, open 'D:\src\wth\tmp\bundle_plugin-input_base_path-x2yQV9tU.tmp\0\D:\src\wth\tmp\broccoli_type_script_compiler-input_base_path-s55KU1HB.tmp\0\main.js.map'
            at Error (native)
    

happens whether or not we use a global installation of ng.

  1. Mention any other details that might be useful.

this worked last week - i did -prod builds at least 15 times on Thursaday. Friday the build server started flaking out and today i could not reproduce it until i removed node_modules and reinstalled it. Thus i suspect it's caused by an updated upstream dependency.

    $ npm info angular-cli

    { name: 'angular-cli',
      time:
       { modified: '2016-05-19T18:44:21.652Z',
         created: '2014-10-07T04:34:38.078Z',
         '1.0.0': '2014-10-07T04:34:38.078Z',
         '0.0.0': '2014-10-11T11:38:24.914Z',
         '0.0.1': '2015-08-03T17:12:04.553Z',
         '0.0.2': '2015-10-18T17:46:40.146Z',
         '0.0.3': '2015-10-18T21:42:52.445Z',
         '0.0.4': '2015-10-19T01:14:13.216Z',
         '0.0.5': '2015-10-19T09:14:01.712Z',
         '0.0.6': '2015-10-19T09:36:51.644Z',
         '0.0.7': '2015-10-19T11:48:24.233Z',
         '0.0.8': '2015-10-19T11:51:59.318Z',
         '0.0.9': '2015-10-19T21:18:13.725Z',
         '0.0.10': '2015-10-19T22:18:13.091Z',
         '0.0.11': '2015-11-03T05:03:06.345Z',
         '0.0.12': '2015-11-15T10:10:48.551Z',
         '0.0.13': '2015-12-04T17:16:43.662Z',
         '0.0.14': '2015-12-05T01:40:39.377Z',
         '0.0.15': '2015-12-05T05:50:59.226Z',
         '0.0.16': '2015-12-10T12:23:28.722Z',
         '0.0.17': '2015-12-14T19:37:08.400Z',
         '0.0.18': '2015-12-15T12:51:47.990Z',
         '0.0.19': '2015-12-15T18:23:33.077Z',
         '0.0.20': '2015-12-15T20:39:55.357Z',
         '0.0.22': '2016-02-20T00:36:56.908Z',
         '0.0.23': '2016-02-20T01:44:13.897Z',
         '0.0.24': '2016-02-25T17:41:20.619Z',
         '0.0.25': '2016-03-10T02:10:05.410Z',
         '0.0.26': '2016-03-23T00:39:46.402Z',
         '0.0.27': '2016-03-23T22:05:56.538Z',
         '0.0.28': '2016-03-28T22:39:45.766Z',
         '0.0.29': '2016-03-30T18:10:47.060Z',
         '0.0.30': '2016-04-06T22:27:32.015Z',
         '0.0.31': '2016-04-11T18:20:32.677Z',
         '0.0.33': '2016-04-19T22:31:48.209Z',
         '0.0.34': '2016-04-26T17:56:20.524Z',
         '0.0.37': '2016-05-03T18:49:21.731Z',
         '0.0.39': '2016-05-04T16:29:23.054Z',
         '0.1.0': '2016-05-05T19:41:05.830Z',
         '1.0.0-beta.0': '2016-05-06T18:18:54.950Z',
         '1.0.0-beta.1': '2016-05-07T16:07:33.383Z',
         '1.0.0-beta.2-mobile': '2016-05-12T06:20:24.207Z',
         '1.0.0-beta.2-mobile.1': '2016-05-13T00:20:37.698Z',
         '1.0.0-beta.2-mobile.2': '2016-05-13T05:55:10.637Z',
         '1.0.0-beta.2-mobile.3': '2016-05-13T23:44:05.921Z',
         '1.0.0-beta.2-mobile.4': '2016-05-17T03:21:36.708Z',
         '1.0.0-beta.4': '2016-05-18T05:37:58.136Z',
         '1.0.0-beta.5': '2016-05-19T18:44:21.652Z' },
      maintainers:
       [ 'angularcore <[email protected]>',
         'rodyhaddad <[email protected]>' ],
      description: 'CLI tool for Angular',
      versions:
       [ '0.0.0',
         '0.0.1',
         '0.0.2',
         '0.0.3',
         '0.0.4',
         '0.0.5',
         '0.0.6',
         '0.0.7',
         '0.0.8',
         '0.0.9',
         '0.0.10',
         '0.0.11',
         '0.0.12',
         '0.0.13',
         '0.0.14',
         '0.0.15',
         '0.0.16',
         '0.0.17',
         '0.0.18',
         '0.0.19',
         '0.0.20',
         '0.0.22',
         '0.0.23',
         '0.0.24',
         '0.0.25',
         '0.0.26',
         '0.0.27',
         '0.0.28',
         '0.0.29',
         '0.0.30',
         '0.0.31',
         '0.0.33',
         '0.0.34',
         '0.0.37',
         '0.0.39',
         '0.1.0',
         '1.0.0-beta.0',
         '1.0.0-beta.1',
         '1.0.0-beta.4',
         '1.0.0-beta.5',
         '1.0.0-beta.2-mobile',
         '1.0.0-beta.2-mobile.1',
         '1.0.0-beta.2-mobile.2',
         '1.0.0-beta.2-mobile.3',
         '1.0.0-beta.2-mobile.4' ],
      'dist-tags':
       { beta: '1.0.0-beta.1',
         mobile: '1.0.0-beta.2-mobile.4',
         latest: '1.0.0-beta.5' },
      readmeFilename: 'README.md',
      homepage: 'https://github.com/angular/angular-cli',
      keywords: [],
      repository:
       { type: 'git',
         url: 'git+https://github.com/angular/angular-cli.git' },
      author: 'Angular Authors',
      bugs: { url: 'https://github.com/angular/angular-cli/issues' },
      license: 'MIT',
      contributors:
       [ 'Rody Haddad <[email protected]> (http://rodyhaddad.com/)',
         'Igor Minar <[email protected]>' ],
      users: { altrim: true, seachange: true, albertobasalo: true },
      version: '1.0.0-beta.5',
      main: 'lib/cli/index.js',
      trackingCode: 'UA-8594346-19',
      bin: { ng: './bin/ng' },
      scripts: { test: 'node tests/runner', lint: 'eslint .' },
      engines: { node: '>= 4.1.0' },
      dependencies:
       { broccoli: '^1.0.0-beta.7',
         'broccoli-caching-writer': '^2.2.1',
         'broccoli-concat': '^2.2.0',
         'broccoli-funnel': '^1.0.1',
         'broccoli-merge-trees': '^1.1.1',
         'broccoli-source': '^1.1.0',
         'broccoli-uglify-js': '^0.1.3',
         'broccoli-writer': '^0.1.1',
         chalk: '^1.1.3',
         'ember-cli': '2.5.0',
         'ember-cli-string-utils': '^1.0.0',
         exit: '^0.1.2',
         'fs-extra': '^0.30.0',
         glob: '^7.0.3',
         handlebars: '^4.0.5',
         leek: '0.0.21',
         lodash: '^4.11.1',
         opn: '4.0.1',
         resolve: '^1.1.7',
         shelljs: '^0.7.0',
         'silent-error': '^1.0.0',
         'symlink-or-copy': '^1.0.3',
         'systemjs-builder': '0.15.17',
         typescript: '^1.8.10',
         typings: '^0.8.1' },
      'ember-addon': { paths: [ './addon/ng2/' ] },
      devDependencies:
       { chai: '^3.5.0',
         eslint: '^2.8.0',
         'exists-sync': '0.0.3',
         minimatch: '^3.0.0',
         mocha: '^2.4.5',
         'mock-fs': '^3.8.0',
         'object-assign': '^4.0.1',
         rewire: '^2.5.1',
         sinon: '^1.17.3',
         through: '^2.3.8',
         tslint: '^3.8.1',
         'walk-sync': '^0.2.6' },
      gitHead: '8e2ee297c7365635228d78b79c58edc0bbc466cf',
      dist:
       { shasum: '89ba7bf7b828abe27de0dfbb67ebbfcaea23ad4c',
         tarball: 'https://registry.npmjs.org/angular-cli/-/angular-cli-1.0.0-beta.5.tgz' },
      directories: {} }
@sgbeal
Copy link
Author

sgbeal commented May 23, 2016

reproduced with 0.0.39 and 0.0.37, so the hypothesis of an upstream dep bug looks more plausible. It does not happen with 0.0.34 (but 0.0.34 is apparently the last version which does not create bundles).

Current client workaround: downgrade to 0.0.34

@sgbeal sgbeal changed the title -prod build fails on blank (ng new) project: looking for .map files -prod build fails, repro. on blank (ng new) project: looking for .map files May 23, 2016
@mdocter
Copy link

mdocter commented May 23, 2016

I have this same issue with version 1.0.0-beta.0

@mdocter
Copy link

mdocter commented May 23, 2016

Duplicate of #847. Will be picked up later today.

@serhiisol
Copy link
Contributor

I have same problem

$ ng build -prod
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
⠹ Building"{{content-for}}" has been deprecated and will be removed before RC.
Build failed.
The Broccoli Plugin: [BundlePlugin] failed with:
Error on fetch for main.js at file:///Users/serhiysolonko/Development/Projects/web-app/tmp/bundle_plugin-input_base_path-FJSsV3T2.tmp/0/main.js
    Error: ENOENT: no such file or directory, open '/Users/serhiysolonko/Development/Projects/web-app/tmp/bundle_plugin-input_base_path-FJSsV3T2.tmp/0/Users/serhiysolonko/Development/Projects/web-app/tmp/broccoli_type_script_compiler-input_base_path-adPphwiO.tmp/0/main.js.map'
    at Error (native)

The broccoli plugin was instantiated at:
    at BundlePlugin.Plugin (/Users/serhiysolonko/Development/Projects/web-app/node_modules/broccoli-plugin/index.js:10:31)
    at BundlePlugin.CachingWriter [as constructor] (/Users/serhiysolonko/Development/Projects/web-app/node_modules/broccoli-caching-writer/index.js:21:10)
    at BundlePlugin (/Users/serhiysolonko/Development/Projects/web-app/node_modules/angular-cli/lib/broccoli/angular-broccoli-bundle.js:10:36)
    at Angular2App._getBundleTree (/Users/serhiysolonko/Development/Projects/web-app/node_modules/angular-cli/lib/broccoli/angular2-app.js:421:22)
    at Angular2App._buildTree (/Users/serhiysolonko/Development/Projects/web-app/node_modules/angular-cli/lib/broccoli/angular2-app.js:159:21)
    at new Angular2App (/Users/serhiysolonko/Development/Projects/web-app/node_modules/angular-cli/lib/broccoli/angular2-app.js:53:23)
    at module.exports (/Users/serhiysolonko/Development/Projects/web-app/angular-cli-build.js:6:10)
    at Class.module.exports.Task.extend.setupBroccoliBuilder (/Users/serhiysolonko/Development/Projects/web-app/node_modules/angular-cli/lib/models/builder.js:55:19)
    at Class.module.exports.Task.extend.init (/Users/serhiysolonko/Development/Projects/web-app/node_modules/angular-cli/lib/models/builder.js:89:10)
    at new Class (/Users/serhiysolonko/Development/Projects/web-app/node_modules/core-object/core-object.js:18:12)
    at Class.module.exports.Task.extend.run (/Users/serhiysolonko/Development/Projects/web-app/node_modules/angular-cli/lib/tasks/build.js:15:19)
    at /Users/serhiysolonko/Development/Projects/web-app/node_modules/angular-cli/lib/commands/build.js:32:24
    at lib$rsvp$$internal$$tryCatch (/Users/serhiysolonko/Development/Projects/web-app/node_modules/rsvp/dist/rsvp.js:1036:16)
    at lib$rsvp$$internal$$invokeCallback (/Users/serhiysolonko/Development/Projects/web-app/node_modules/rsvp/dist/rsvp.js:1048:17)
    at /Users/serhiysolonko/Development/Projects/web-app/node_modules/rsvp/dist/rsvp.js:331:11
    at lib$rsvp$asap$$flush (/Users/serhiysolonko/Development/Projects/web-app/node_modules/rsvp/dist/rsvp.js:1198:9)

@sgbeal
Copy link
Author

sgbeal commented May 23, 2016

@SergeySolonko see #847 for many more details and a potential fix.

@filipesilva
Copy link
Contributor

Is this still happening with new projects?

The logs here show Building"{{content-for}}" has been deprecated and will be removed before RC. which would only happen on old projects that were upgraded to beta.5.

@filipesilva
Copy link
Contributor

Also, can you verify that both the local and global angular-cli versions are the same?

@sgbeal
Copy link
Author

sgbeal commented May 26, 2016

@filipesilva this isn't a new project, but i can confirm that, using 1.0.0-beta.5 (both global and local) with the vendorNpmFiles configuration shown below results in ng not copying a subset of the vendor JS files which we load via index.html (shown on the right of the image):

selection_021

It does copy these in a non-prod build.
i have no idea how to force ng to copy the missing ones - i expect them to be copied because they're defined in vendorNpmFiles.

@yahyaKacem
Copy link

yahyaKacem commented May 26, 2016

@filipesilva I tested it with a new project here's what I found:
a change to the index.html file is required for <base href="/"> to this <base href="{{environment.baseURL}}"> after that the app will work but 2 errors 1 during build the other about live reload in the browser this is with both ng serve -prod & ng build -prod:

$ ng build -prod 
(node:17834) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
⠸ Building(node:17834) DeprecationWarning: 'root' is deprecated, use 'global'
(node:17834) DeprecationWarning: 'GLOBAL' is deprecated, use 'global'
Built project successfully. Stored in "dist/".
File sizes:
 - index.js: 1.34 KB (621 B gzipped)
 - testing-build-prod.component.css: 0 B
 - main.js: 674.14 KB (139.3 KB gzipped)
 - system-config.js: 1.49 KB (475 B gzipped)
 - es6-shim.js: 131.74 KB (30.4 KB gzipped)
 - Reflect.js: 36.91 KB (5.29 KB gzipped)
 - system.src.js: 159.57 KB (38.99 KB gzipped)
 - zone.js: 52.72 KB (11.37 KB gzipped)

errors during build:

(node:17834) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
(node:17834) DeprecationWarning: 'root' is deprecated, use 'global'
(node:17834) DeprecationWarning: 'GLOBAL' is deprecated, use 'global'

then in the browser:

GET http://127.0.0.1:35729/livereload.js?ext=Chrome&extver=2.1.0 net::ERR_CONNECTION_REFUSED injected.js:142

Note: also it's worth mentioning that ng serve -prod and ng build -prod could have different baseURL since the ng serve -prod serve the current directory and ng build -prod could have a different baseURL with subfolders.

but with an old project or new I'm still having problem with libraries.

@filipesilva
Copy link
Contributor

@sgbeal the prod builds cannot bundle js files defined in script tags in index.html, you must instead configure it via SystemJS (as global packages I'd wager).

@filipesilva
Copy link
Contributor

@sgbeal I don't see how this issue related to #951 (comment). Can you elaborate?

@sgbeal
Copy link
Author

sgbeal commented Jun 3, 2016

Because in trying to resolve #888, the closest i got to a resolution was the behaviour described in #951. (And only got that far via an explicit "import 'blah'" of all the 3rd-party JS, instead of importing it via index.html.) i still can't get a working -prod build on any version newer than 0.0.34 (the last version which didn't do bundling).

@filipesilva
Copy link
Contributor

Ah I reread it a couple of times and I think I understand. Your previous examples showed errors on user libs, not the base script ones. Your user libs you must load via systemjs, but es6-shim and systemjs should be loaded automatically.

Very odd that they're 404'ing. On a brand new project the prod build loads it. I need to investigate this further.

@filipesilva filipesilva reopened this Jun 3, 2016
@filipesilva
Copy link
Contributor

I know I asked before, but please tell me again so I can try to debug: what exact version are you using when that happens? Global install and local install.

@sgbeal
Copy link
Author

sgbeal commented Jun 3, 2016

i've tried with local 0.0.39, 1.0.0-beta.1, and beta.5. Global... i don't recall what that machine has and won't have access to it again until Monday. The exact result varies widely, from the .map.js not being found (despite using +(js|map.js) in all my wildcards), to a blank page with no errors (as described in #951), to 404'ing of the es6 shims and systemjs, depending, seemingly, on the time of day, phase of the moon, and the temperature. For one particular run, which i could not reproduce later, it bundled (apparently) properly but failed to load the app because bootstrap was being loaded before jquery (despite their import order being correct in index.ts), causing an exception from some bootstrap component. So close, yet so very far...

This morning i ran multiple attempts with beta.1 and .5, along with various versions of systemjs (.26-29), and eventually gave up and went back to 0.0.34 and systemjs .27 (which is where we'll stay, at least until our project launch week after next, after which i hope to have more time/budget to investigate build infrastructure alternatives).

@filipesilva
Copy link
Contributor

It might be a problem with the local/global mismatch. The upgrade process isn't very straightforward right now, but downgrading is not really supported at all.

I've never seen the 404 for systemjs/es6-shim while trying to repro with global and local beta.5, so when you have time can you try those?

@filipesilva filipesilva added the needs: repro steps We cannot reproduce the issue with the information given label Jun 3, 2016
@sgbeal
Copy link
Author

sgbeal commented Jun 3, 2016

i will try that on Monday. Sending myself a reminder now.

@davidrensh
Copy link

Still same

Build failed.
The Broccoli Plugin: [BundlePlugin] failed with:
Error on fetch for vendor/angularfire2/angularfire2.js at file:///D:/X530/NDE/tmp/bundle_plugin-input_base_path-KSpOTfys.tmp/0/vendor/angularfire2/angularfire2.js
        Loading main.js
        Error: ENOENT: no such file or directory, open 'D:\X530\NDE\tmp\bundle_plugin-input_base_path-KSpOTfys.tmp\0\vendor\angularfire2\angularfire2.js.map'
    at Error (native)

@filipesilva
Copy link
Contributor

@davidrensh see #847 (comment) for a solution to your problem.

@sgbeal
Copy link
Author

sgbeal commented Jun 8, 2016

Regarding my comment from 5 days ago (retrying this with various global/local versions): i have been asked by management not to invest any more time in trying to update our build infrastructure, which means we'll be sticking with 0.0.34 until (at least) our initial release (next week). Whether or not there will be project-level interest in resp. budget for pursuing build-level improvements or replacements after that is unknown.

@filipesilva
Copy link
Contributor

@sgbeal I understand. Dealing with the ebb and flow of beta (and alpha when started!) tooling software is very time consuming, exponentially so in more complex projects.

@sgbeal
Copy link
Author

sgbeal commented Jun 17, 2016

ahoy! It turns out that the requirement for Windows admin rights in Broccoli is not allowed at our customer's site, so i tried a newer ng version where that is fixed... with ng beta.6 and systemjs 0.19.31, the behavior described in this ticket has disappeared. We can now build using -prod and the result is uable (was simply a blank page/console).

@sgbeal sgbeal closed this as completed Jun 17, 2016
@filipesilva
Copy link
Contributor

@sgbeal I'm glad to hear that!

Since you're using it on a real environment I have to warn you to this current critical issue in beta.6 #1092. I think the best way for you to get around it is to not use the new router which should be fine because you're using the old router I believe.

I'd also like tell you that we now have an upgrade guide and a changelog which should help when upgrading projects.

@serhiisol
Copy link
Contributor

👍

@sgbeal
Copy link
Author

sgbeal commented Jun 17, 2016

Doh. No, we're using the new (RC1) router. Thanks for the head's up. So far we haven't seen that problem (and i'll cross my fingers that the guy doing the code review on my copy doesn't run into it).

@filipesilva
Copy link
Contributor

We're waiting for a new router release that fixes it, which should be soon, and then we'll cut a beta.7 release.

@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 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: repro steps We cannot reproduce the issue with the information given type: bug/fix
Projects
None yet
Development

No branches or pull requests

6 participants