gshigeto / ionic-environment-variables

Easy to use environment variables for Ionic3!
MIT License
276 stars 36 forks source link

Fixed env not defined. Added sourcemaps to .gitignore #28

Open predorock opened 6 years ago

predorock commented 6 years ago

When I have pulled the repo, running npm run ionic:serve I got the error that env was not defined.

➜  ionic-environment-variables git:(master) ✗ npm run ionic:serve

> ionic-environment-variables@0.0.1 ionic:serve /Users/predo1/Documents/dev-projects/ionic-environment-variables
> ionic-app-scripts serve

[19:11:43]  ionic-app-scripts 3.0.0
[19:11:43]  watch started ...
[19:11:43]  build dev started ...
[19:11:43]  clean started ...
[19:11:43]  clean finished in 2 ms
[19:11:43]  copy started ...
[19:11:43]  deeplinks started ...
[19:11:43]  deeplinks finished in 31 ms
[19:11:43]  transpile started ...

./src/environments/environment.undefined.ts does not exist!
There was an error in config file "/<path-to>/ionic-environment-variables/config/webpack.config.js". Using defaults instead.
TypeError: Path must be a string. Received undefined
    at assertPath (path.js:28:11)
    at Object.resolve (path.js:1171:7)
    at Object.<anonymous> (/<path-to>/ionic-environment-variables/config/webpack.config.js:20:22)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
[19:11:46]  transpile finished in 2.70 s
[19:11:46]  preprocess started ...
[19:11:46]  copy finished in 2.89 s
[19:11:46]  preprocess finished in 97 ms
[19:11:46]  webpack started ...

./src/environments/environment.undefined.ts does not exist!
There was an error in config file "/<path-to>/ionic-environment-variables/config/webpack.config.js". Using defaults instead.
TypeError: Path must be a string. Received undefined
    at assertPath (path.js:28:11)
    at Object.resolve (path.js:1171:7)
    at Object.<anonymous> (/<path-to>/ionic-environment-variables/config/webpack.config.js:20:22)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
c[19:11:54]  webpack finished in 7.90 s
[19:11:54]  sass started ...
[19:11:55]  sass finished in 1.28 s
[19:11:55]  postprocess started ...
[19:11:55]  postprocess finished in 5 ms
[19:11:55]  lint started ...
[19:11:55]  build dev finished in 12.11 s
[19:11:56]  watch ready in 12.18 s
[19:11:56]  dev server running: http://localhost:8100/

[19:12:00]  lint finished in 4.15 s

My pr has fixed the problem. I have also removed the .sourcemaps folder from versioning. node 8.11.1 npm 5.6.0 cordova 8.0.0 ioic 3.20.0