meumobi / infomobi

Ionic2 Employee App
3 stars 2 forks source link

can't build prod release: ngx-embed-video Module build failed #225

Open vdias38 opened 5 years ago

vdias38 commented 5 years ago

Expected behaviour

Tell us what should happen

Actual behaviour

$ npm run ionic:build --env=prod --prod

> meu-starter.ionic-v3@0.0.1 ionic:build /Users/victor/Dvpt/PROJECTS/ion-employee
> ionic-app-scripts build && npm run ngsw-config && npm run ngsw-copy

[14:20:17]  ionic-app-scripts 3.1.9 
[14:20:17]  build prod started ... 
[14:20:17]  clean started ... 
[14:20:17]  clean finished in 381 ms 
[14:20:17]  copy started ... 
[14:20:20]  deeplinks started ... 
[14:20:21]  deeplinks finished in 1.17 s 
[14:20:21]  ngc started ... 
[14:23:02]  ngc finished in 161.02 s 
[14:23:02]  preprocess started ... 
[14:23:02]  preprocess finished in 105 ms 
[14:23:02]  webpack started ... 

Using PROD environment variables for PROD build.

Loading ./src/environments/environment.prod.ts

[14:23:06]  copy finished in 168.63 s 
[14:26:53]  ionic-app-script task: "build" 
[14:26:53]  Error: ./node_modules/ngx-embed-video/index.ts Module build failed: Error: ENOENT: no such file or 
            directory, open '/Users/victor/Dvpt/PROJECTS/ion-employee/node_modules/ngx-embed-video/index.js.map' @ 
            ./src/pages/video-details/video-details.module.ngfactory.js 39:0-45 @ ./src lazy @ 
            ./node_modules/ionic-angular/util/ng-module-loader.js @ ./src/app/app.module.ngfactory.js @ 
            ./src/app/main.ts,./node_modules/ngx-embed-video/src/embed-video.service.ts Module build failed: Error: 
            ENOENT: no such file or directory, open 
            '/Users/victor/Dvpt/PROJECTS/ion-employee/node_modules/ngx-embed-video/src/embed-video.service.js' @ 
            ./src/pages/video-details/video-details.module.ngfactory.js 31:0-63 @ ./src lazy @ 
            ./node_modules/ionic-angular/util/ng-module-loader.js @ ./src/app/app.module.ngfactory.js @ 
            ./src/app/main.ts 
Error: ./node_modules/ngx-embed-video/index.ts
Module build failed: Error: ENOENT: no such file or directory, open '/Users/victor/Dvpt/PROJECTS/ion-employee/node_modules/ngx-embed-video/index.js.map'
 @ ./src/pages/video-details/video-details.module.ngfactory.js 39:0-45
 @ ./src lazy
 @ ./node_modules/ionic-angular/util/ng-module-loader.js
 @ ./src/app/app.module.ngfactory.js
 @ ./src/app/main.ts,./node_modules/ngx-embed-video/src/embed-video.service.ts
Module build failed: Error: ENOENT: no such file or directory, open '/Users/victor/Dvpt/PROJECTS/ion-employee/node_modules/ngx-embed-video/src/embed-video.service.js'
 @ ./src/pages/video-details/video-details.module.ngfactory.js 31:0-63
 @ ./src lazy
 @ ./node_modules/ionic-angular/util/ng-module-loader.js
 @ ./src/app/app.module.ngfactory.js
 @ ./src/app/main.ts
    at new BuildError (/Users/victor/Dvpt/PROJECTS/ion-employee/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28)
    at callback (/Users/victor/Dvpt/PROJECTS/ion-employee/node_modules/@ionic/app-scripts/dist/webpack.js:121:28)
    at emitRecords.err (/Users/victor/Dvpt/PROJECTS/ion-employee/node_modules/webpack/lib/Compiler.js:269:13)
    at Compiler.emitRecords (/Users/victor/Dvpt/PROJECTS/ion-employee/node_modules/webpack/lib/Compiler.js:375:38)
    at emitAssets.err (/Users/victor/Dvpt/PROJECTS/ion-employee/node_modules/webpack/lib/Compiler.js:262:10)
    at applyPluginsAsyncSeries1.err (/Users/victor/Dvpt/PROJECTS/ion-employee/node_modules/webpack/lib/Compiler.js:368:12)
    at next (/Users/victor/Dvpt/PROJECTS/ion-employee/node_modules/tapable/lib/Tapable.js:218:11)
    at Compiler.compiler.plugin (/Users/victor/Dvpt/PROJECTS/ion-employee/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
    at Compiler.applyPluginsAsyncSeries1 (/Users/victor/Dvpt/PROJECTS/ion-employee/node_modules/tapable/lib/Tapable.js:222:13)
    at Compiler.afterEmit (/Users/victor/Dvpt/PROJECTS/ion-employee/node_modules/webpack/lib/Compiler.js:365:9)
npm ERR! code ELIFECYCLE

Steps to reproduce

1. 2. 3.

Expected responses

vdias38 commented 5 years ago

Issue referenced on repo of pugin SamirHodzic/ngx-embed-video/issues/21 Can't achieve to compile project including plugin, then I've decided to copy EmbedVideoService (v1.0.2) on source code of our project. Should be fixed for Angular 6 with latest version of plugin.

danconte72 commented 5 years ago

I've created a copy of ngx-embed-video based on this post And released here

ionic serve and npm run ionic:build --prod worked properly

danconte72 commented 5 years ago

main differences so far: on meumobi: index and module file. next- remove files to keep the same structure

danconte72 commented 5 years ago

it worked removing module

danconte72 commented 5 years ago

next step:

danconte72 commented 5 years ago

it worked with same package dependencies versions, only adding files key on package.json

vdias38 commented 5 years ago

When I try with v1.0.4 of package it raises following error for prod

victors-MacBook-Pro-2:ion-employee victor$ npm run ionic:build:pwa --prod

> infomobi@1.0.0 preionic:build:pwa /Users/victor/Dvpt/PROJECTS/ion-employee
> gulp preprocess --mode=pwa

[04:07:07] Using gulpfile ~/Dvpt/PROJECTS/ion-employee/gulpfile.js
[04:07:07] Starting 'preprocess'...
[04:07:08] Finished 'preprocess' after 434 ms

> infomobi@1.0.0 ionic:build:pwa /Users/victor/Dvpt/PROJECTS/ion-employee
> ionic-app-scripts build && npm run ngsw-config && npm run ngsw-copy

[04:07:24]  ionic-app-scripts 3.1.9 
[04:07:24]  build prod started ... 
[04:07:24]  clean started ... 
[04:07:24]  clean finished in 10 ms 
[04:07:24]  copy started ... 
[04:07:27]  deeplinks started ... 
[04:07:27]  deeplinks finished in 856 ms 
[04:07:27]  ngc started ... 
[04:08:54]  typescript error 
            Unexpected value 'EmbedVideo in 
            /Users/victor/Dvpt/PROJECTS/ion-employee/node_modules/ngx-embed-video/dist/index.js' imported by the module 
            'VideoDetailsPageModule in 
            /Users/victor/Dvpt/PROJECTS/ion-employee/src/pages/video-details/video-details.module.ts'. Please add a 
            @NgModule annotation. 

[04:08:54]  ionic-app-script task: "build" 
[04:08:54]  Error: The Angular AoT build failed. See the issues above 
Error: The Angular AoT build failed. See the issues above
    at /Users/victor/Dvpt/PROJECTS/ion-employee/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:237:55
    at step (/Users/victor/Dvpt/PROJECTS/ion-employee/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:32:23)
    at Object.next (/Users/victor/Dvpt/PROJECTS/ion-employee/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:13:53)
    at fulfilled (/Users/victor/Dvpt/PROJECTS/ion-employee/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:4:58)
    at <anonymous>
npm ERR! code ELIFECYCLE
bhaumikdarji commented 5 years ago

Hi,

I have used your api but I got below issue while building it

ERROR in ./node_modules/meumobi-ngx-embed-video/index.ts Module build failed: Error: /Users/bhaumikdarji/Documents/Development/QuixSolution/php/InterimarketAppV2/webapp/node_modules/meumobi-ngx-embed-video/index.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv). at AngularCompilerPlugin.getCompiledFile (/Users/bhaumikdarji/Documents/Development/QuixSolution/php/InterimarketAppV2/webapp/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:674:23) at plugin.done.then (/Users/bhaumikdarji/Documents/Development/QuixSolution/php/InterimarketAppV2/webapp/node_modules/@ngtools/webpack/src/loader.js:467:39) at at process._tickCallback (internal/process/next_tick.js:188:7) ERROR in ./node_modules/meumobi-ngx-embed-video/src/embed-video.service.ts Module build failed: Error: /Users/bhaumikdarji/Documents/Development/QuixSolution/php/InterimarketAppV2/webapp/node_modules/meumobi-ngx-embed-video/src/embed-video.service.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv). at AngularCompilerPlugin.getCompiledFile (/Users/bhaumikdarji/Documents/Development/QuixSolution/php/InterimarketAppV2/webapp/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:674:23) at plugin.done.then (/Users/bhaumikdarji/Documents/Development/QuixSolution/php/InterimarketAppV2/webapp/node_modules/@ngtools/webpack/src/loader.js:467:39) at at process._tickCallback (internal/process/next_tick.js:188:7)