Skip to content

ng build -prod The Broccoli Plugin: [BundlePlugin] failed with: #1024

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
prafsoni opened this issue Jun 6, 2016 · 11 comments
Closed

ng build -prod The Broccoli Plugin: [BundlePlugin] failed with: #1024

prafsoni opened this issue Jun 6, 2016 · 11 comments

Comments

@prafsoni
Copy link

prafsoni commented Jun 6, 2016

  1. Mac OSX El Capiton
  2. ng --version

(node:35374) 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.
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
angular-cli: 1.0.0-beta.5
node: 6.2.1
os: darwin x64

  1. App was created using CLI. It was working before but stopped working suddenly.
  2. Log

Prafulls-MacBook-Pro:prafsoni.github.io PKS$ ng build -prod
(node:35467) 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.
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.
⠸ Building(node:35467) DeprecationWarning: 'root' is deprecated, use 'global'
(node:35467) DeprecationWarning: 'GLOBAL' is deprecated, use 'global'
Build failed.
The Broccoli Plugin: [BundlePlugin] failed with:
Error on fetch for main.js at file:///Users/PKS/Desktop/websites/prafsoni.github.io/tmp/bundle_plugin-input_base_path-iblGMnnC.tmp/0/main.js
Error: ENOENT: no such file or directory, open '/Users/PKS/Desktop/websites/prafsoni.github.io/tmp/bundle_plugin-input_base_path-iblGMnnC.tmp/0/Users/PKS/Desktop/websites/prafsoni.github.io/tmp/broccoli_type_script_compiler-input_base_path-F2xbwtcg.tmp/0/main.js.map'
at Error (native)

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

@prafsoni prafsoni changed the title ng build -prod failed The Broccoli Plugin: [BundlePlugin] failed with: Jun 6, 2016
@prafsoni prafsoni changed the title The Broccoli Plugin: [BundlePlugin] failed with: ng build -prod The Broccoli Plugin: [BundlePlugin] failed with: Jun 6, 2016
@w0bbes
Copy link

w0bbes commented Jun 6, 2016

+1.... really frustating I have to say. I know i'm not contributing to this repo, I know I'm not suppose to whine and bitch about stuff not working, but i'm expecting some form of quality from this project. It's in beta and not working at all for me and this is the second chance I'm giving it.

Again, sorry I'm not raging or anything, i just have high hopes for this project.

Thanks for the efforts though.

@devversion
Copy link
Member

I have a temporary fix for that (will be submitted once, the bundler deployed a new release)

I also discussed with @hansl about that ( but probably he will think about it again ).

I recently made a change to the SystemJS builder, which allows developers to disable the sourcemap tracing.

The PR for the CLI, will allow developers to overwrite the SystemJS builder options (quite useful IMO)

{
  bundleOptions: {
    sourceMaps: false
  }
}

Waiting for a new release of the SystemJS builder, which includes this option for recursive imports as well.

@prafsoni
Copy link
Author

prafsoni commented Jun 6, 2016

Thanks @devversion
Is there any work around for now?

@demetrio812
Copy link

Same problem here, a temporary workaround would be nice to have...

@demetrio812
Copy link

Fixed the problem by following this comment: #847 (comment)

However the production build tries to load the single js files for each component by they aren't in the dist build

@filipesilva
Copy link
Contributor

The fix for the source maps problem occurs when upgrading projects to beta.5 from previous versions. Starting a new project will not have this issue. We're still working on adding changelogs so that these breaking changes are documented.

The upgrade procedure which fixes this issue is the one @demetrio812 linked to: #847 (comment)

@filipesilva
Copy link
Contributor

@demetrio812 That sounds like a different issue. Are you adding script tags to index.html? You'll need to instead configure those packages in SystemJS as global, see #1015

@demetrio812
Copy link

demetrio812 commented Jun 7, 2016

@filipesilva the problem is that if I do ng build all the js files for the components (in app/)are generated and it works properly, if I do ng build -prod it just copy the html and css files and it tries (failing) to load the components.

As a temporary workaround I ended up copying the content of environment.prod.ts into environment.dev.ts, do ng build and then restore the dev environment file. By setting production to true the vendor files are minimised and the app is fairly fast, even if being a small app an option to combine and minify everything would be cool (I know for bigger apps it's better to have modules, that's why I'd make it optional).

Let me know your thoughts, I can open a different issue if you want.

@filipesilva
Copy link
Contributor

@demetrio812 the reason js files are not copied is that ng build -prod bundles every js file via SystemJS. If you have files that aren't being bundled, that's likely because you don't have them in SystemJS.

Changing the production variable inside environment.dev.ts doesn't actually produce bundled, minified builds, it simply tells angular that it is running on production mode thus removing the console message at bootstrap (among other things Angular 2 related at runtime).

If you haven't added script tags and still get 404 on needed files, please do open a new issue with repro steps and I will look at it.

@demetrio812
Copy link

Hello @filipesilva I'll look into it and will open a new issue with a description to reproduce it, cheers!

@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
None yet
Projects
None yet
Development

No branches or pull requests

5 participants