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

angular2-polyfills.js:1243 Error: SyntaxError: Unexpected token < #23

Closed
rocco-scaramuzzi opened this issue Apr 4, 2016 · 3 comments
Closed

Comments

@rocco-scaramuzzi
Copy link

Hi There,

when adding the ng2-oploader I got this run-time error: Error: SyntaxError: Unexpected token <(…) at angular2-polyfills.js:1243. Any reason why? I am using SystemJS to boostrap the app and I am using angular-quick-start 2.0.0-beta.9.

It will be very appreciated any help.
Thanks

@jkuri
Copy link
Contributor

jkuri commented Apr 4, 2016

Hi, how did you include it to your project? If you can create a plunkr I can take a look.
Cheers

@rocco-scaramuzzi
Copy link
Author

Hi Jan, thanks for your answer. I have just fixed it by including reference in System.Config packages and paths as following:

<script>
        System.config({
            packages: {
                "/poster-manager-app": {
                format: 'register',
                defaultExtension: 'js'
                },
                'node_modules/ng2-uploader': {
                    format: 'register',
                    defaultExtension: 'js'
                }
            },
            paths: {
                "ng2-uploader": "node_modules/ng2-uploader/ng2-uploader"
            }

        });
        System.import('/poster-manager-app/main')
                .then(null, console.error.bind(console));
</script>

Instead at the beginning I was including with script tag <script src="../../node_modules/ng2-uploader/ng2-uploader.js"></script>

I think adding that in System.Config should be the right way to fix that issue. Thanks so much for the simple and clean directive, I will start to use it.

Cheers,
Rocco

@jkuri
Copy link
Contributor

jkuri commented Apr 4, 2016

Nice to hear that! Sure, no problem.

@jkuri jkuri closed this as completed Apr 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants