Reputation: 1908
I'm running through the Angular2 webpack sample app at https://angular.io/docs/ts/latest/guide/webpack.html
I've just finished the "Development Configuration" section and I've attempted the "try it out" by copying in the app at the bottom of the page and calling npm start, however all I see is the "loading" and I get "Cannot read property 'call' of undefined" at polyfills.js 1 in the console.
I've gone back through the files and copy/pasted everything in directly in case of a typo. I also tried pushing the requires for zone up as far as I could in polyfills.ts due to the warnings about it in the tutorial.
I'd appreciate any suggestions as to what the problem could be or even if somebody else could attempt to get the app running at this point ( I've skipped the production and testing since it seems like you should be able to run the app at this point )
I've put a copy of my site so far at https://github.com/Liam-Ryan/Angular2WebpackSite
Upvotes: 1
Views: 3070
Reputation: 2023
In index.html you have to include the files in order. Like below
<script type="text/javascript" src="inline.3ad0b6817eee19f5cfa7.bundle.js"></script>
<script type="text/javascript" src="vendor.e20d1d1e0582bef2c46a.bundle.js"></script>
<script type="text/javascript" src="main.65eaac6ecefe3725ca56.bundle.js"></script>
Otherwise it will throw error. I had same problem. when I interchange the vendor and main bundle.js files. Hope this will help you.
Upvotes: 0
Reputation: 1908
I received help on the angular gitter. Initially it was thought that the problem was Webstorms typescript compiler which had compiled the .js and maps which was interfering with webpack-dev-server. After deleting the maps the issue still persisted. In the meantime RC7 was released and the package.json of the documentation was updated to include these and some other updated packages.
After updating package.json I no longer saw the error. I've updated the code to be working at the github link above in case anyone else runs into this issue, you can just clone or download the one in the repository.
Upvotes: 1