Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Bundling fails on version 0.9.0 #386

Closed
erkanarslan opened this issue Dec 30, 2017 · 6 comments
Closed

Bundling fails on version 0.9.0 #386

erkanarslan opened this issue Dec 30, 2017 · 6 comments

Comments

@erkanarslan
Copy link

erkanarslan commented Dec 30, 2017

When I was using version 0.8.0 of this plugin, I was able to bundle my project for Android. After following the upgrade guide, I get this error:

ERROR in ../node_modules/nativescript-timedatepicker/timedatepicker-handler.ts
Module build failed: Error: /home/zarax/code/cubicl-mobile/node_modules/nativescript-timedatepicker/timedatepicker-handler.ts is not part of the compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
    at NativeScriptAngularCompilerPlugin.getCompiledFile (/home/zarax/code/cubicl-mobile/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:643:23)
    at NativeScriptAngularCompilerPlugin.getCompiledFile (/home/zarax/code/cubicl-mobile/node_modules/nativescript-dev-webpack/plugins/NativeScriptAngularCompilerPlugin.ts:75:22)
    at plugin.done.then (/home/zarax/code/cubicl-mobile/node_modules/@ngtools/webpack/src/loader.js:467:39)
 @ ./shared/services/helper.service.ts 12:21-59
 @ ./shared/core.module.ts
 @ ./app.module.ts
 @ ./main.ts
Webpack compilation complete.
Executing webpack failed with exit code 2.

It seems that bundling is not working because of timedatepicker plugin.

Another problem is that operation fails when --env.aot flag is used:

ERROR in ./main.aot.ts
Module build failed: Error: /home/zarax/code/cubicl-mobile/app/main.aot.ts is not part of the compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
    at NativeScriptAngularCompilerPlugin.getCompiledFile (/home/zarax/code/cubicl-mobile/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:643:23)
    at NativeScriptAngularCompilerPlugin.getCompiledFile (/home/zarax/code/cubicl-mobile/node_modules/nativescript-dev-webpack/plugins/NativeScriptAngularCompilerPlugin.ts:75:22)
    at plugin.done.then (/home/zarax/code/cubicl-mobile/node_modules/@ngtools/webpack/src/loader.js:467:39)
@jogboms
Copy link

jogboms commented Dec 30, 2017

For the aot issue, can i see your tsconfig.json file to make sure you are not excluding .aot.ts?

@erkanarslan
Copy link
Author

I was trying to upgrade my development setup. I undid my changes because I was getting these errors. I don't have the tsconfig.json from that time now and I don't remember if I excluded .aot.ts files. I will notify you when I check it.

@erkanarslan
Copy link
Author

@jogboms Yes, It seems that .aot.ts file was excluded. That one is fixed but still I get error related to timedatepicker. If I remove timedatepicker references from my code bundling works.

@erkanarslan
Copy link
Author

It seems that this problem is related timedatepicker plugin. @souly1 prepared a solution for this issue: AntonioCuevaUrraco/nativescript-timedatepicker#41

Anyone who faces this problem can create a .js file under hooks/before-prepare and put this code into that file.

Closing this issue.

@crutchcorn
Copy link

The problem was fixed for me by removing the tsconfig rule for .aot.ts exclusion. However, now when I run tns run, I get the following error:
../../../../../app/main.aot.ts(4,36): error TS2307: Cannot find module './app.module.ngfactory'.

How can I satisfy both AOT and dev builds?

@sis0k0
Copy link
Contributor

sis0k0 commented Jan 9, 2018

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

4 participants