shlomiassaf / ngc-webpack

Angular compiler-cli with webpack's loader chain.
MIT License
84 stars 15 forks source link

Build fails in gitlab ci #22

Open klimentLambevski opened 7 years ago

klimentLambevski commented 7 years ago

I have a build that works in circle ci on docker image circleci/node:7.10 and custom docker image with node:8.1.2 but fails on gitlab ci on the same images. This is the error

Starting compilation using the angular compiler. Angular compilation done, starting webpack bundling. Error: Child compilation failed: Module parse failed: /builds/team-birowsky/cscade-frontend/app/src/components/app/app.html Unexpected token (1:0) You may need an appropriate loader to handle this file type. | <csc-header | [mainMenuIsOpened]="mainMenuIsOpenedSubj.asObservable().distinctUntilChanged() | async" | [userMenuIsOpened]="userMenuIsOpenedSubj.asObservable().distinctUntilChanged() | async": SyntaxError: Unexpected token (1:0) at /builds/team-birowsky/cscade-frontend/node_modules/ngc-webpack/src/webpack-resource-loader.js:51:28 at Compiler.<anonymous> (/builds/team-birowsky/cscade-frontend/node_modules/webpack/lib/Compiler.js:291:10) at /builds/team-birowsky/cscade-frontend/node_modules/webpack/lib/Compiler.js:494:13 at next (/builds/team-birowsky/cscade-frontend/node_modules/tapable/lib/Tapable.js:184:11) at Compiler.<anonymous> (/builds/team-birowsky/cscade-frontend/node_modules/webpack/lib/CachePlugin.js:62:5) at Compiler.applyPluginsAsyncSeries (/builds/team-birowsky/cscade-frontend/node_modules/tapable/lib/Tapable.js:188:13) at /builds/team-birowsky/cscade-frontend/node_modules/webpack/lib/Compiler.js:491:10 at Compilation.applyPluginsAsyncSeries (/builds/team-birowsky/cscade-frontend/node_modules/tapable/lib/Tapable.js:177:46) at self.applyPluginsAsync.err (/builds/team-birowsky/cscade-frontend/node_modules/webpack/lib/Compilation.js:645:19) at Compilation.applyPluginsAsyncSeries (/builds/team-birowsky/cscade-frontend/node_modules/tapable/lib/Tapable.js:177:46) at self.applyPluginsAsync.err (/builds/team-birowsky/cscade-frontend/node_modules/webpack/lib/Compilation.js:636:11) at next (/builds/team-birowsky/cscade-frontend/node_modules/tapable/lib/Tapable.js:184:11) at Compilation.compilation.plugin (/builds/team-birowsky/cscade-frontend/node_modules/webpack/lib/optimize/UglifyJsPlugin.js:230:5) at Compilation.applyPluginsAsyncSeries (/builds/team-birowsky/cscade-frontend/node_modules/tapable/lib/Tapable.js:188:13) at self.applyPluginsAsync.err (/builds/team-birowsky/cscade-frontend/node_modules/webpack/lib/Compilation.js:631:10) at Compilation.applyPluginsAsyncSeries (/builds/team-birowsky/cscade-frontend/node_modules/tapable/lib/Tapable.js:177:46) at sealPart2 (/builds/team-birowsky/cscade-frontend/node_modules/webpack/lib/Compilation.js:627:9) at Compilation.applyPluginsAsyncSeries (/builds/team-birowsky/cscade-frontend/node_modules/tapable/lib/Tapable.js:177:46) at Compilation.seal (/builds/team-birowsky/cscade-frontend/node_modules/webpack/lib/Compilation.js:575:8) at /builds/team-birowsky/cscade-frontend/node_modules/webpack/lib/Compiler.js:488:16 at /builds/team-birowsky/cscade-frontend/node_modules/tapable/lib/Tapable.js:271:11 at _addModuleChain (/builds/team-birowsky/cscade-frontend/node_modules/webpack/lib/Compilation.js:477:11) at processModuleDependencies.err (/builds/team-birowsky/cscade-frontend/node_modules/webpack/lib/Compilation.js:448:13) at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9)

I don't see why it should not work on gitlab ci because the docker images are the same. Maybe some enviorment variables make a problem?

shlomiassaf commented 7 years ago

I don't think this is an ngc-webpack issue...

The resource loader in ngc-webpack is using the original webpack configuration, maybe there are some path issues there or something...