-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
app.module.ngfactory failing PRD build #8312
Comments
Hello, thanks for opening an issue with us! Could you post a repo that I can use to reproduce this issue? |
I figured it out, but only after creating a completely new project and transferring the components, etc to it. Once I did that, I ran ionic run android and saw the following:
For some reason this particular log entry isn't showing up in my original project, so I'm assuming there's a parameter that I have to set to verbose (or something to that effect). Either way, once that was fixed the build was fine. Any idea what changed from the old version to the new in regards to logging messages? |
Nothing that we know of. Glad you were able to get it resolved 😄 I'm going to close this issue. Thanks, |
Hello, i have the same issue, attached the error stack
It works well if i run ionic serve, but got this error if i run ionic run android any idea, thanks for the help. |
I have the exact same problem, so it seems this is a problem affecting a number of people. |
but if i compile with ionic serve and then run cordova run android --device 2016-10-03 11:14 GMT+02:00 BiteMyBucket [email protected]:
|
Hello, I'm getting a similar issue when trying to use ionic build as well as when I try to emulate it on ios. Using ionic serve works properly on my local environment.
|
+1 I have the same issue as well |
Me too |
I too can run ionic serve on my local browser but when trying to run on my android device am getting the same error: [15:19:15] Error: Could not resolve entry (.tmp/app/main.prod.js) Please advise us on what to do? |
Hello all, Can you try installing the latest app scripts and see if that resolves your issue or provides a better error message?
Thanks, |
I tried the latest release of app-scripts (0.0.28), but I get the same error on prod builds. When checking in the .tmp-dir, I see that it does not contain any .js files (only .ts), so it's probably skipping the transpilation step from typescript to javascript. EDIT: [16:54:42] ngc failed: Unable to find Angular Compiler "ngc" command: null I guess these errors were omitted before. |
For some reason some of the error messages are being omitted, so all you see is that the main.js file is missing. I had to start from a new project (migrating my code to it) in order to see what's actually failing. Basically, something is missing in the instructions on how to migrate your current project to RC0 |
updated the app-scripts, i also updated the node and npm versions, and got a diferent error, but still dont run. i got this message
this is the error compiling
And here the ionic info
|
Are you running Dang, that error message is not very helpful 😄 . Can you dig in and see if you can get something else from it? Do you have Thanks, |
Thanks Dan for the interest, |
I'm having exactly the same problem as above (when I run ionic build). I noticed that there is a missing module in the main.prod.ts file in the app dir... the AppModuleNgFactory class is imported in the main.prod.ts file but there is no app.module.ngfactory.ts file. I tried to create one but really, I am new to all this and all I do fail. please help!! |
If some one can create the constructor in that missing app.module.ngfactory.ts file then I think it might resolve this issue. |
@danbucholtz Yes. I'm running Node v6.7.0 and NPM v3.10.8. I can see the EDIT: Well, I'm not sure what caused the afforementioned problem, but after I deleted By running |
@kami-ruvice, The Can everyone make sure there Also try blowing away the Thanks, |
Deleted
ionic info
Temporary using @jorgedkoala method to work around
It's work !!! |
It appears there are a couple of different issues that are similar, so things to check:
The Angular's Ahead of time (AoT) compiler is very strict and what passes for dev mode probably isn't passing for production mode. |
Double checked
Still hitting the same error while
But I notice
How to solve this? |
Hello SOLVED in my case, after updated the app-scripts i could find the error Produced by how i was calling "My Fault" the TranslateStaticLoader of ng2-translate service. |
@FanYeeChok As stated by @danbucholtz, the ngfactory is part of the ngc compilation and it's normal that it's missing from the src/app directory. |
package.json:
rollup.config.js :
Your system information:
I got this error :( any suggestion @adamdbradley @FanYeeChok
|
@danbucholtz here is the link for the node_modules |
Can you install the latest version of
|
Thanks, |
@danbucholtz i just installed and the installed successful but i tried to run npm run build again and i got the same erros. i'm just stuck with it from morning, i thought to format my pc because i have many erros all the week i can't make my app because that. |
If you run Thanks, |
@danbucholtz yes npm 3.10.8 and node version v6.8.0 |
@danbucholtz i just deleted all my files of ionic,cordova,npm,nodejs and installed again. |
I am getting the same issue. Using latest npm, node versions and ionic app-scripts. |
+1 Emulator (ionic emulate ios) was working fine up until latest updates here http://blog.ionic.io/ionic-2-rc-weekend-updates I have blown away node_modules + installed latest scripts. Environment (latest) npm 3+ and node 6+. NOTE: ionic serve works fine. Up until suggested changes here i had been able to run it under xcode, now that's not working either :-( Error message:
|
Can you give us a sample repo (dumbed down, very simple project) and recreate the issue? We are seeing reports of the Thanks, |
My issue was resolved in the thrad It was an issue from my code where i changed the App name. Thanks, On Mon, Oct 17, 2016 at 8:11 PM, Dan Bucholtz [email protected]
|
@danbucholtz It also points out bugs in Is there any chance to get some CLI options to disable certain features such as |
We will have a fix out for that shortly. Thanks, |
@danbucholtz so that's frustrating... I've created a new app to replicate issues and it all works fine i.e. ionic emulate fires up fine. I have also added changes released over the weekend. NOTE: dummy app was a basic start "ionic start testAPP tabs".. is this ok? Totally stumped... Any suggestions? |
Same ISSUE. |
getting error on running watch or serve on RC1
using following ionic configurations.
|
That looks like a legitimate compiler error. Can you try fixing the errors and try again? Thanks, |
@FanYeeChok try this in main.ts it worked for me |
@danbucholtz prod build is running well, getting errors only on watch and build on dev. |
I have the same problem: I receive the "Cannot find module './app.module.ngfactory'. " error when I run ionic build, but not when running the serve. I have updated the scripts, node, npm, etc. as recommended here. I have removed the node_modules, .tmp and www directories multiple times before rebuilding. I am able to build the tutorial app. I believe the problem is in an external .js based node_module that I added, probably either ng2-charts or angular2-select. The biggest problem is that there is no real error message provided, so I don't know how to fix it. I have read elsewhere that the problem might be that a .manifest.json file needs to exist in the third party module. If so, what would that need to look like? |
We just got this on our TeamCity build agents, but not on local machines. After quite a bit of debugging, it turned out the build agents had a newer version of TypeScript. Locking our version of TypeScript to version 2.0.9 solved the problem for us (both Android and iOS builds). TLDR: |
@vegardlarsen Thanks. Solved My issue. |
@jorgedkoala Thanks! I solve change: |
thanks @vegardlarsen you saved my night 👍 |
For anyone else stumbling upon this and the above not working, I got the error that main.dev.ts & main.prod.ts was deprecated and to create a main.ts file from the following link and delete the other two. Worked like a charm and ios build works. yet to try android. |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Short description of the problem:
Getting the following:
The AppModuleNgFactory cannot be resolved:
So main.prd.ts doesn't compile and the whole build fails.
I've searched all over and couldn't find an appropriate fix for this issue.
What behavior are you expecting?
I can build the project and run it on android
Steps to reproduce:
Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)
Which Ionic Version? 1.x or 2.x
v2 RC.0
Run
ionic info
from terminal/cmd prompt: (paste output below)Cordova CLI: 6.2.0
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
OS: Distributor ID: Ubuntu Description: Ubuntu 16.04.1 LTS
Node Version: v6.7.0
npm -v
3.10.8
node -v
v6.7.0
The text was updated successfully, but these errors were encountered: