Ionic Pro Build Fail: Cannot find module '../providers/testprovider.ts

Running with gitlab-ci-multi-runner 9.1.0 (0118d89)
on ip-10-2-245-240 (c9648220)
Using Shell executor…
Running on ip-10-2-245-240…
Cloning repository…
Cloning into ‘/home/gitlab-runner/builds/c9648220/2/project-1’…
Checking out d8898a97 as master…
Skipping Git submodules setup
$ run "fetch-updates"
Running Stage fetch-updates for Job: 5247818
Checking for build process updates…
$ run "build-app"
Running Stage build-app for Job: 5247818
Parsing ionic.config.json for project settings
Project Settings:
Name: ghra-app
App ID: 47c94f48
Type: ionic-angular
Build script detected in package.json…
$ npm install --quiet --no-optional

node-sass@4.7.2 install /usr/src/app/node_modules/node-sass
node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.7.2/linux-x64-57_binding.node
Download complete
Binary saved to /usr/src/app/node_modules/node-sass/vendor/linux-x64-57/binding.node
Caching binary to /home/gitlab-runner/.npm/node-sass/4.7.2/linux-x64-57_binding.node

uglifyjs-webpack-plugin@0.4.6 postinstall /usr/src/app/node_modules/uglifyjs-webpack-plugin
node lib/post_install.js

node-sass@4.7.2 postinstall /usr/src/app/node_modules/node-sass
node scripts/build.js

Binary found at /usr/src/app/node_modules/node-sass/vendor/linux-x64-57/binding.node
Testing binary
Binary is fine
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})

added 686 packages in 44.624s
$ npm install --quiet --no-optional success
$ npm run build
npm info it worked if it ends with ok
npm info using npm@5.3.0
npm info using node@v8.2.1
npm info lifecycle ghra-app@0.0.1~prebuild: ghra-app@0.0.1
npm info lifecycle ghra-app@0.0.1~build: ghra-app@0.0.1

ghra-app@0.0.1 build /usr/src/app
ionic-app-scripts build

[05:36:50] ionic-app-scripts 3.1.8
[05:36:50] build dev started …
[05:36:50] clean started …
[05:36:50] clean finished in 2 ms
[05:36:50] copy started …
[05:36:50] deeplinks started …
[05:36:50] deeplinks finished in 102 ms
[05:36:50] transpile started …
**[05:36:57] typescript: src/app/app.module.ts, line: 16 **
** Cannot find module ‘…/providers/test.provider’. **

** L15: import { Pro } from ‘@ionic/pro’;**
** L16: import { TestProvider } from ‘…/providers/test.provider’**
** L17: import { DeviceinfoProvider } from ‘…/providers/deviceinfo’;**

**[05:36:57] typescript: src/app/app.module.ts, line: 17 **
** Cannot find module ‘…/providers/deviceinfo’. **

** L16: import { TestProvider } from ‘…/providers/test.provider’**
** L17: import { DeviceinfoProvider } from ‘…/providers/deviceinfo’;**
** L18: import { ErrorpostProvider } from ‘…/providers/errorpost’;**

**[05:36:57] typescript: src/app/app.module.ts, line: 18 **
** Cannot find module ‘…/providers/errorpost’. **

** L17: import { DeviceinfoProvider } from ‘…/providers/deviceinfo’;**
** L18: import { ErrorpostProvider } from ‘…/providers/errorpost’;**

[05:36:57] ionic-app-script task: “build” **
[05:36:57] Error: Failed to transpile program **
Error: Failed to transpile program
** at new BuildError (/usr/src/app/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28)

** at /usr/src/app/node_modules/@ionic/app-scripts/dist/transpile.js:159:20

** at Promise ()**
** at transpileWorker (/usr/src/app/node_modules/@ionic/app-scripts/dist/transpile.js:107:12)**
** at Object.transpile (/usr/src/app/node_modules/@ionic/app-scripts/dist/transpile.js:64:12)**
** at /usr/src/app/node_modules/@ionic/app-scripts/dist/build.js:109:82**
** at **
npm info lifecycle ghra-app@0.0.1~build: Failed to exec build script
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ghra-app@0.0.1 build: ionic-app-scripts build
npm ERR! Exit status 1
**npm ERR! **
npm ERR! Failed at the ghra-app@0.0.1 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/gitlab-runner/.npm/_logs/2018-01-22T05_36_57_752Z-debug.log
npm run build failed
Running after script…
$ run "clean-up"
Running Stage clean-up for Job: 5247818
ERROR: Job failed: exit status 1

3 dots? That doesn’t look like a valid path. It should probably be ../providers/test.provider.

Try 2 dots, 3 isn’t valid

import { ErrorpostProvider } from ‘../providers/errorpost’;

I guess their is a typo in my post there are only two dots (import {
TestProvider } from ‘…/providers/test.provider’ )
it only happen when I use providers. but locally everything works fine

down below is build log

Running with gitlab-ci-multi-runner 9.1.0 (0118d89) on ip-10-2-95-244
(c9648220) Using Shell executor… Running on ip-10-2-95-244… Cloning
repository… Cloning into
’/home/gitlab-runner/builds/c9648220/2/project-1’… Checking out d8898a97
as master… Skipping Git submodules setup $ run “fetch-updates” Running
Stage fetch-updates for Job: 5247834 Checking for build process updates… $
run “build-app” Running Stage build-app for Job: 5247834 Parsing
ionic.config.json for project settings Project Settings: Name: ghra-app App
ID: 47c94f48 Type: ionic-angular Build script detected in package.json… $
npm install --quiet --no-optional > node-sass@4.7.2 install
/usr/src/app/node_modules/node-sass > node scripts/install.js Downloading
binary from
https://github.com/sass/node-sass/releases/download/v4.7.2/linux-x64-57_binding.node
Download complete Binary saved to
/usr/src/app/node_modules/node-sass/vendor/linux-x64-57/binding.node
Caching binary to
/home/gitlab-runner/.npm/node-sass/4.7.2/linux-x64-57_binding.node >
uglifyjs-webpack-plugin@0.4.6 postinstall
/usr/src/app/node_modules/uglifyjs-webpack-plugin > node
lib/post_install.js > node-sass@4.7.2 postinstall
/usr/src/app/node_modules/node-sass > node scripts/build.js Binary found at
/usr/src/app/node_modules/node-sass/vendor/linux-x64-57/binding.node
Testing binary Binary is fine npm WARN optional SKIPPING OPTIONAL
DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents): npm WARN notsup
SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3:
wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
added 686 packages in 66.04s $ npm install --quiet --no-optional success $
npm run build npm info it worked if it ends with ok npm info using npm@5.3.0
npm info using node@v8.2.1 npm info lifecycle ghra-app@0.0.1~prebuild:
ghra-app@0.0.1 npm info lifecycle ghra-app@0.0.1~build: ghra-app@0.0.1 >
ghra-app@0.0.1 build /usr/src/app > ionic-app-scripts build [05:56:13]
ionic-app-scripts 3.1.8 [05:56:13] build dev started … [05:56:13] clean
started … [05:56:13] clean finished in 3 ms [05:56:13] copy started …
[05:56:13] deeplinks started … [05:56:13] deeplinks finished in 147 ms
[05:56:13] transpile started … [05:56:24] typescript:
src/app/app.module.ts, line: 16 Cannot find module
’…/providers/test.provider’. L15: import { Pro } from ‘@ionic/pro’; L16:
import { TestProvider } from ‘…/providers/test.provider’ L17: import {
DeviceinfoProvider } from ‘…/providers/deviceinfo’; [05:56:24] typescript:
src/app/app.module.ts, line: 17 Cannot find module
’…/providers/deviceinfo’. L16: import { TestProvider } from
’…/providers/test.provider’ L17: import { DeviceinfoProvider } from
’…/providers/deviceinfo’; L18: import { ErrorpostProvider } from
’…/providers/errorpost’; [05:56:24] typescript: src/app/app.module.ts,
line: 18 Cannot find module ‘…/providers/errorpost’. L17: import {
DeviceinfoProvider } from ‘…/providers/deviceinfo’; L18: import {
ErrorpostProvider } from ‘…/providers/errorpost’; [05:56:24]
ionic-app-script task: “build” [05:56:24] Error: Failed to transpile
program Error: Failed to transpile program at new BuildError
(/usr/src/app/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28) at
/usr/src/app/node_modules/@ionic/app-scripts/dist/transpile.js:159:20 at
Promise () at transpileWorker
(/usr/src/app/node_modules/@ionic/app-scripts/dist/transpile.js:107:12) at
Object.transpile
(/usr/src/app/node_modules/@ionic/app-scripts/dist/transpile.js:64:12) at
/usr/src/app/node_modules/@ionic/app-scripts/dist/build.js:109:82 at npm
info lifecycle ghra-app@0.0.1~build: Failed to exec build script npm ERR!
code ELIFECYCLE npm ERR! errno 1 npm ERR! ghra-app@0.0.1 build:
ionic-app-scripts build npm ERR! Exit status 1 npm ERR! npm ERR! Failed
at the ghra-app@0.0.1 build script. npm ERR! This is probably not a problem
with npm. There is likely additional logging output above. npm ERR! A
complete log of this run can be found in: npm ERR!
/home/gitlab-runner/.npm/_logs/2018-01-22T05_56_24_164Z-debug.log npm run
build failed Running after script… $ run “clean-up” Running Stage
clean-up for Job: 5247834 ERROR: Job failed: exit status 1

Can you provide us app.module.ts file?

exact same problem for me.
app.module.ts has:
import { RemoteServiceProvider } from ‘…/providers/remote-service/remote-service’;

build always fails with Cannot find module ‘…/providers’ etc