GithubHelp home page GithubHelp logo

Comments (25)

kennyhyun avatar kennyhyun commented on July 19, 2024 1

I checked out rc1 and the issue today.
When I tested removing es6-shim from bundle.js and adding it manually in the build directory, the error was gone.
Uglifying es6-shim might have a problem. and 0.35.1(latest) was the same.

Anyway, from this idea, I adjusted es6-shim's position after system.js and used es6-shim.js instead of es6-shim.min.js. That was a solution(walkaround).

<!-- 1. Load libraries -->
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/reflect-metadata/Reflect.js"></script>
<script src="node_modules/systemjs/dist/system.js"></script>

<!-- Polyfill(s) for older browsers -->
<script src="node_modules/es6-shim/es6-shim.js"></script>
<!-- endbuild -->

I'll PR this soon.

--- update ---
Changing es6-shim.min.js to es6-shim.js was not necessary.

from angular-starter.

antonybudianto7 avatar antonybudianto7 commented on July 19, 2024

Hi, did it only happen using Safari? how about other browsers?
you can try SystemJS polyfills here
By the way I'm going to switch to SFX build (no systemjs in bundle) soon, can you try the sfx-build-2 branch and test against Safari?

Thanks for the report.

from angular-starter.

talmog avatar talmog commented on July 19, 2024

Thank you for your prompt response.
The error does happen only in Safari.
SystemJS polyfills are not solving the problem here.
Also the new SFX branch has the same error and an additional one:
reflect-metadata shim is required when using class decorators

from angular-starter.

talmog avatar talmog commented on July 19, 2024

By the way, it was working until beta.17

from angular-starter.

kennyhyun avatar kennyhyun commented on July 19, 2024

I don't know much about the reason but this might work.
I have inserted two js in the index.html right before System.import

<script src="node_modules/es6-shim/es6-shim.min.js"></script>
<script src="node_modules/angular2/es6/dev/src/testing/shims_for_IE.js"></script>

from angular-starter.

talmog avatar talmog commented on July 19, 2024

Is node_modules/angular2 folder there? isn't it now node_modules/@angular?

from angular-starter.

kennyhyun avatar kennyhyun commented on July 19, 2024

Sorry, I haven't tried rc1 yet. but you can do similar things.

from angular-starter.

talmog avatar talmog commented on July 19, 2024

I'll give it a try

from angular-starter.

talmog avatar talmog commented on July 19, 2024

Still getting the same error :(

from angular-starter.

antonybudianto7 avatar antonybudianto7 commented on July 19, 2024

how about gulp serve-dev? is it only not working when bundled?
already try https://github.com/stefanpenner/es6-promise before systemjs script tag?

from angular-starter.

talmog avatar talmog commented on July 19, 2024

gulp serve-dev works fine on Safari. it is the bundle that breaks.
Es6-promise didn't help either. I also tried es6-sham, es5-shim and es5-sham.
I tried the angular-cli new tool and it's build does run on safari. I really don't want to migrate the project there, and rather just find a solution for this problem with your starter.

from angular-starter.

antonybudianto avatar antonybudianto commented on July 19, 2024

okay, can you try to turn off either minify or mangle option in gulp.config.js file?

from angular-starter.

talmog avatar talmog commented on July 19, 2024

I tried it before, just tried it again. no success.

from angular-starter.

antonybudianto avatar antonybudianto commented on July 19, 2024

I get it working by removing

<script src="node_modules/es6-shim/es6-shim.min.js"></script>

Looks like I need to remove it in next release and just ask the IE users to add them manually

from angular-starter.

talmog avatar talmog commented on July 19, 2024

but then you get many other errors...

from angular-starter.

antonybudianto avatar antonybudianto commented on July 19, 2024

what kind of error did you get?
I used sfx-build-2 branch and just comment out es6-shim part in index, then serve build it, it run well on Safari Version 9.0 (11601.1.56)
I'd suggest to update your Safari version

from angular-starter.

talmog avatar talmog commented on July 19, 2024

When you remove the es6-shim, then the regular un-bundled version doesn't load (on sfx-build-2).
Also I get the same error when I build.
For my project also the bundled version generates many other errors if I don't include the es6-shim.

Sorry, this is a hard one!

from angular-starter.

antonybudianto avatar antonybudianto commented on July 19, 2024

Sorry, cannot help much without details and not reproducable in my side since it's indeed working.
I will leave it open for someone else having same issue or fix

from angular-starter.

dottodot avatar dottodot commented on July 19, 2024

I have the same issue. With these included

  <script src="node_modules/es6-shim/es6-shim.min.js"></script>
  <script src="node_modules/zone.js/dist/zone.js"></script>
  <script src="node_modules/reflect-metadata/Reflect.js"></script>
  <script src="node_modules/systemjs/dist/system.js"></script>

serve-dev works in all browsers, however serve-build breaks things in Safari and IE. If I remove es6-shim Safari works fine but IE is broken with the error

cannot redefine non-configurable property 'Reflect'

from angular-starter.

antonybudianto7 avatar antonybudianto7 commented on July 19, 2024

Feel free to open PR if you have a fix for this, thank you.

P.S: I still recommend using newer or modern browsers if possible, and I personally don't feel like supporting older IE browsers

from angular-starter.

dottodot avatar dottodot commented on July 19, 2024

The only way I can get it to work is too not bundle those scripts so it must be something to do with systemjs-builder but no idea what.

from angular-starter.

antonybudianto avatar antonybudianto commented on July 19, 2024

wow, it's great @kennyhyun , I look forward to it 👍

from angular-starter.

antonybudianto avatar antonybudianto commented on July 19, 2024

@talmog , can you confirm the fix?

from angular-starter.

dottodot avatar dottodot commented on July 19, 2024

Works for me.

from angular-starter.

talmog avatar talmog commented on July 19, 2024

confirmed! thank you!

from angular-starter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.