-
Notifications
You must be signed in to change notification settings - Fork 12k
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
ng build -prod fails with two errors #917
Comments
Did you run it as administrator? Also, it seems the build went fine, the error seems to come from the file sizes report you get after the build has finished. |
Yes, the cmd window is always admin. Manually deleted the two empty directories and it worked fine. |
prod compiled. it will not run. should I be looking for bootstrap in that file? ng serve -prod results in Loading... and the app never runs. ng serve runs with no problems. |
Odd. Do you have any console errors when doing |
I agree. Here's my output: C:\Users\rkr0079\Source\Repos\nrmn-account>ng serve -prod Build successful - 13997ms. Slowest Trees | Total Slowest Trees (cumulative) | Total (avg) |
Hm... what about on the browser console, any errors? |
Nope. No errors anywhere. I looked in the main.js. It is returning the bootstrap call; but it is buried way deep in the file. I'm not sure how to go about debugging this to see where it is failing. |
When I prettify main.js, the following is on line 22916 when looked at in ff and a breakpoint is not hit: |
Tried moving to a fresh machine. Now prod fails with the following: C:\Users\Keith\Source\Repos\nrmn-account>ng -v C:\Users\Keith\Source\Repos\nrmn-account>ng build -prod The broccoli plugin was instantiated at: The development build continues to work flawlessly. Does my version of the CLI matter? If so, how should I upgrade? |
ng build -prod produces a main.js with System.registerDynamic("main.js" ... in the middle. When I move that code to the end, the application runs. Attaching the file. Not exactly sure what I need to do to get this to build properly. |
I have tried updating the CLI with npm i angular-cli. This does not work. How should I update the CLI? |
I forced an upgrade. I got the error when building to prod that tmp resources did not exist. I have rolled back to beta 2. |
This fails for me too on Mac. Same error in the tmp folder |
@kara : angular-cli: 1.0.0-beta.2-mobile.4 builds OK. It has issues removing folders which it has emptied. It also will build the main.js in the wrong order once the project gets complicated. I tried Beta 5 to see if these issues were fixed. However, both of these can be worked around by manually deleting empty folders and rebuilding; and manually editing the main.js and moving System.registerDynamic('main.js', . . . to the end of the file. |
This may add some insight? beta.5 |
@rkralston @kara the broken map errors are fixed in beta.5 (not the mobile one though) but can be fixed in a project by changing Another user ran into a similar problem in |
@filipesilva I'm still having the map issue in beta.5:
Debian Jessie. |
That sorted the build, but serve still borked (only shows the "Loading...") with no errors.
|
Still fails for me. I have made the requested changes to angular-cli-build.js and tsconfig.json. C:\Users\rkr0079\Source\Repos\nrmn-account>ng build -prod The broccoli plugin was instantiated at: C:\Users\rkr0079\Source\Repos\nrmn-account>ng -v |
Fixed by making the same change to file extensions for angular2-jwt : I'm still having trouble with |
The prod build builds. However, This and the directories not deleting were my problems with the older build. I still have to manually intervene to get a built application. What do I need to do to get that the main.js to be inserted at the end of the file? |
@rkralston glad that it's working now, although I can't help much with the @yusijs @rkralston as far as I can tell, the blank |
@filipesilva Could you let us know the issue# @ systemjs when you've got one written down? Thanks. |
@filipesilva unfortunately, this is not closed. Beta 5 builds, but the build is still broken. I tried the explicit format for moment, it does not change anything.
still gets thrown into the middle of main.js and prevents the application from bootstrapping. When I manually move this to the end of the file, it works. |
@rkralston I found the easiest way to work around this for now, is to include main.js as a script tag in index.html. |
@yusijs thanks, that work around works for me too. |
@yusijs I put up the issue number here #951 (comment) @rkralston the original issue |
@rkralston actually... do you have more 3rd party libs other than moment? Because you might need to add in the format for all of them, not just moment. |
Yes I do. I'll post it when I get back home. Not sure about the format thing. Can you point me to documentation? On Fri, Jun 3, 2016 at 7:50 AM -0700, "Filipe Silva" [email protected] wrote: @rkralston actually... do you have more 3rd party libs other than moment? Because you might need to add in the format for all of them, not just moment. You are receiving this because you were mentioned. |
Thnx On Fri, Jun 3, 2016 at 7:46 AM -0700, "Filipe Silva" [email protected] wrote: @yusijs I put up the issue number here #951 (comment) @rkralston the original issue You are receiving this because you were mentioned. |
The list of module formats that SystemJS supports are here: https://github.com/systemjs/systemjs/blob/master/docs/module-formats.md Maybe start with adding the equivalent of
For all the other packages, and see if it works then. |
No joy. I'v attached a zip of my config files and the subsequent main.js. @yusijs 's work around still holds. You can see that main.js is being loaded in the middle of the file. |
@rkralston yeap, definitely Your configs and everything seem ok, but without checking a running project I can't really reproduce it. If you can post a repository I can debug in #951, I can look at it and see what I can find. |
We're using bitbucket. Can I add you to a project there? On Tue, Jun 7, 2016 at 1:01 PM -0500, "Filipe Silva" [email protected] wrote: @rkralston yeap, definitely Your configs and everything seem ok, but without checking a running project I can't really reproduce it. If you can post a repository I can debug in #951, I can look at it and see what I can find. You are receiving this because you were mentioned. |
@rkralston can you try with beta.6? We started bundling stuff differently and the issue should be completely fixed. |
Removed all instances of cli and only installed globally. When I tried the build, it complained I installed the cli locally and the build ran. I'm still having issues with the removal of empty directories. This represents a difference in the dev and prod builds. If something in dev is moved to main.js in prod, it is not cleaning up those directories appropriately. I have to run the prod build three times to get a successful build. SUCCESS!! main.js is now built in the proper order!!!! |
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. |
ng --version
. If there's nothing outputted, pleaserun in a Terminal:
node --version
And paste the result here.
date it to a more recent version.
angular-cli: 1.0.0-beta.2-mobile.4
node: 6.1.0
os: win32 x64
do on your code? etc.
I have built a small but extensive application. I am attaching some of the configuration files. Please let me know if you need more.
I ran ng init just to make sure I had everything for the CLI.
ng build -prod
more information.
I am not aware of a log file created by build. Here's the screen shot:
C:\Users\rkr0079\Source\Repos\nrmn-account>ng build -prod
(node:6264) 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:6264) DeprecationWarning: 'root' is deprecated, use 'global'
(node:6264) DeprecationWarning: 'GLOBAL' is deprecated, use 'global'
Built project successfully. Stored in "dist/".
File sizes:
fs.js:95
throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs
^
Error: ENOTEMPTY: directory not empty, rmdir 'C:\Users\rkr0079\Source\Repos\nrmn-account\dist\vendor\ng2-bootstrap\components'
at Error (native)
nrmn-accounts.zip
The text was updated successfully, but these errors were encountered: