Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using core-js with Angular 2 #5614

Closed
rolandjitsu opened this issue Dec 4, 2015 · 4 comments
Closed

using core-js with Angular 2 #5614

rolandjitsu opened this issue Dec 4, 2015 · 4 comments

Comments

@rolandjitsu
Copy link

I was trying to compile my project directly to ES6 and use core-js for shims (they seem to cover a lot more than es6-shim), but it looks like I get a an error:

TypeError: Cannot convert undefined or null to object
angular2.min.js:26Uncaught TypeError: Cannot read property 'getOptional' of undefinedu @ angular2.min.js:26t._initApp @ angular2.min.js:26t.application @ angular2.min.js:26n @ angular2.min.js:26(anonymous function) @ bootstrap.ts:37(anonymous function) @ bootstrap.ts:37U @ system.src.js:4597c.execute @ system.src.js:4597i @ system.src.js:4597n @ system.src.js:4597execute @ system.src.js:4597y @ system.src.js:4597w @ system.src.js:4597p @ system.src.js:4597h @ system.src.js:4597(anonymous function) @ system.src.js:4597n.run @ angular2.min.js:1(anonymous function) @ angular2.min.js:1I @ angular2.min.js:1A @ angular2.min.js:1R @ angular2.min.js:1(anonymous function) @ angular2.min.js:1n.run @ angular2.min.js:1(anonymous function) @ angular2.min.js:1h @ angular2.min.js:1h @ core.js:3055(anonymous function) @ core.js:3066e @ core.js:3310
core.js:3055 Uncaught TypeError: Cannot read property 'getOptional' of undefined
    Evaluating http://localhost:3000/app/bootstrap.js
    Error loading http://localhost:3000/app/bootstrap.jsh @ core.js:3055(anonymous function) @ core.js:3066e @ core.js:3310

Not sure why though. If I compile to ES5, it works perfectly fine.

Here is my tsconfig.json for reference:

{
    "compilerOptions": {
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "module": "commonjs",
        "moduleResolution": "node",
        "noImplicitAny": false,
        "sourceMap": true,
        "target": "es5"
    }
}
@0xcaff
Copy link

0xcaff commented Dec 18, 2015

Try switching your script from angular2.min.js to angular2.dev.js and you should get more information about the problem. Also check your typescript compiler errors.

@wesleycho
Copy link
Contributor

Looks like this is related to the other open issue #5755, referencing for convenience.

@pkozlowski-opensource
Copy link
Member

Closing as duplicate of #5755

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants