Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

[0.0.43] prod build fails, too #367

Closed
michael-brade opened this issue Nov 11, 2016 · 6 comments
Closed

[0.0.43] prod build fails, too #367

michael-brade opened this issue Nov 11, 2016 · 6 comments

Comments

@michael-brade
Copy link

With the new version 0.0.43, the serve goal is broken, as in #361, but so is the build :(

[15:28:04]  copy finished in 102 ms 
[15:28:12]  Error: Error at .../.tmp/app/main.prod.ts:4:36 
[15:28:12]  Cannot find module './app.module.ngfactory'. 
[15:28:12]  ngc failed 
[15:28:12]  ionic-app-script task: "build" 
[15:28:12]  Error: Error 

I thought ngc would create the ngfactory, but there is none in .tmp.

@alan-agius4
Copy link
Contributor

alan-agius4 commented Nov 11, 2016

Do you have the declarations.d.ts file?
Should contain;

declare module '*';

@michael-brade
Copy link
Author

Wow, that was quick!! :) Where should that file be?

@alan-agius4
Copy link
Contributor

alan-agius4 commented Nov 11, 2016

You can place it directly under src, unless you want to add it in typings folder

The important thing that the path is included in your tsconfig.json if you don't place it in src

@michael-brade
Copy link
Author

Yeah, that changes things! Now I get

Error: Metadata emit requires the sourceFiles are passed to WriteFileCallback. Update to TypeScript 
            ^1.9.0-dev

I guess my TypeScript is too new for some feature... I'll try to downgrade to 1.9.

@alan-agius4
Copy link
Contributor

alan-agius4 commented Nov 11, 2016

You can downgrade Typescript to 2.0.9 As Angular compiler is not compatible with TS 2.1.X

@michael-brade
Copy link
Author

Yay, lovely! Thank you very much, with TypeScript 2.0.x and src/declarations.d.ts it now builds again! :)
I'll close this issue again.

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

2 participants