Unmentioned breaking change in 47 due to module es2015 #633
Description
Short description of the problem:
I have a bigger codebase which i migrated from beta.11 till rc4 nightly. after recent upgrade of app-scripts my app was crashing during startup:
TypeError: Cannot convert undefined or null to object
at hasOwnProperty (<anonymous>)
at Function.__webpack_require__.o (http://localhost:8100/build/main.js:60:103)
at Object.<anonymous> (http://localhost:8100/build/main.js:93699:67)
at __webpack_require__ (http://localhost:8100/build/main.js:20:30)
at Object.<anonymous> (http://localhost:8100/build/main.js:52570:73)
at __webpack_require__ (http://localhost:8100/build/main.js:20:30)
at Object.<anonymous> (http://localhost:8100/build/main.js:93461:75)
at __webpack_require__ (http://localhost:8100/build/main.js:20:30)
at Object.<anonymous> (http://localhost:8100/build/main.js:82203:73)
at __webpack_require__ (http://localhost:8100/build/main.js:20:30)
somehow i managed to notice what was causing this issue, since the codebase was working before the update. The change which broke my codebase is the following line in tsconfig.json
:
"module": "es2015",
it was commonjs
before i migrated. This change was introduced earlier.
but until .47 there was indication to change that line.
It is triggered when using TS Namespaces and only if you have a bigger code base (for whatever reason). See this example project
If you change "module": "es2015",
to commonjs
the app starts as expected. Also the app starts as expected if you remove the importing line in home.ts
or and thats strange, delete any other model from models.
It seems to be an issue with webpack? But i don't know webpack well so i cant tell exactly whats going on.
What behavior are you expecting?
I expect this example project to work with the recommended setting "module": "es2015",
or the recommendation to be changed to commonjs
.
Steps to reproduce:
- check out project
- run
npm install
- run
ionic serve
https://github.com/ataraxus/issue-es2015
Which @ionic/app-scripts version are you using?
Your system information:
ordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.4
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
Ionic App Scripts Version: 1.0.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 7
Node Version: v6.9.1
Xcode version: Not installed