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

Website does not work because `Object.assign is not a function` #45

Closed
azproduction opened this issue Nov 4, 2015 · 10 comments
Closed

Website does not work because `Object.assign is not a function` #45

azproduction opened this issue Nov 4, 2015 · 10 comments
Labels

Comments

@azproduction
Copy link

@azproduction azproduction commented Nov 4, 2015

No description provided.

@soyjavi

This comment has been minimized.

Copy link
Contributor

@soyjavi soyjavi commented Nov 4, 2015

I think you can give more information about your problem.

@azproduction

This comment has been minimized.

Copy link
Author

@azproduction azproduction commented Nov 4, 2015

So I am using a browser which does not support Object.assign yet. It should be polyfilled.

@javivelasco

This comment has been minimized.

Copy link
Member

@javivelasco javivelasco commented Nov 4, 2015

You´re right. Doing it asap, I've been quite busy these 2 days with Reactive Conf

@azproduction

This comment has been minimized.

Copy link
Author

@azproduction azproduction commented Nov 4, 2015

Good luck with react-toolbox, looks promising!

@javivelasco

This comment has been minimized.

Copy link
Member

@javivelasco javivelasco commented Nov 4, 2015

Thanks for your kind words :)!

@MarkPieszak

This comment has been minimized.

Copy link

@MarkPieszak MarkPieszak commented Nov 4, 2015

+1 for Chrome, same issue

@javivelasco

This comment has been minimized.

Copy link
Member

@javivelasco javivelasco commented Nov 4, 2015

More details on Chrome version, OS, etc?

@MarkPieszak

This comment has been minimized.

Copy link

@MarkPieszak MarkPieszak commented Nov 4, 2015

Latest Chrome on iPad Air 2. Version 46.0.2490.73
It just keeps loading, but nothing ever appears, let me see if I can get you any more info!

@soyjavi soyjavi added the wontfix label Nov 4, 2015
@guerrero

This comment has been minimized.

Copy link

@guerrero guerrero commented Nov 5, 2015

It seems that @azproduction is using Chrome on a version older than iOS 9. In iOS, Chrome uses the same engine as Safari and Safari for iOS only supports Object.assign() in >iOS 9. I've also tried to run react-toolbox.com on my iPad with iOS 8 and it crashes, but if I open the same page on my iPhone, which is running 9.1, it works as expected.

Anyway, the bug is there and, as @azproduction has said, Object.assign should be polyfilled. So there are two ways to solve this problem:

  1. Add babel-plugin-transform-object-assign following the next steps:

    1. Run npm install --save-dev babel-plugin-transform-object-assign
    2. Add the following lines to your webkit config:
    loaders: [
      {
        test: /(\.js|\.jsx)$/,
        exclude: /(node_modules)/,
        loader: 'babel'
        query: {
          plugins: ['transform-object-assign']
        }
      }, {
  2. Use an npm module like object-assign:

    1. Run npm install --save object-assign
    2. Import and use object-assign instead of Object.assign

I think that the first option is better because it enables a way to use the standard method and you shouldn't import an npm package each time you want to use Object.assign, but I wanted to enumerate all possible ways to solve this problem.

I'm commenting on this issue instead of open a PR because this has a wontfix label and I don't know if you're currently working on solve it or if you are waiting to something but, if you want, I can elaborate the PR.

@javivelasco

This comment has been minimized.

Copy link
Member

@javivelasco javivelasco commented Nov 5, 2015

Thanks for your comment @guerrero. I think the label was there by mistake. Instead of using a polyfill or a transform and since I think we were using Object.assign only in the prefixer code, it can be better avoid. I've just uploaded the update. If I'm missing some code still using assign still, feel free to open a PR.

Thank you so much for your comment :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.