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

Comments

@azproduction
Copy link

No description provided.

@soyjavi
Copy link
Contributor

soyjavi commented Nov 4, 2015

I think you can give more information about your problem.

@azproduction
Copy link
Author

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

@javivelasco
Copy link
Member

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

@azproduction
Copy link
Author

Good luck with react-toolbox, looks promising!

@javivelasco
Copy link
Member

Thanks for your kind words :)!

@MarkPieszak
Copy link

+1 for Chrome, same issue

@javivelasco
Copy link
Member

More details on Chrome version, OS, etc?

@MarkPieszak
Copy link

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
Copy link

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
Copy link
Member

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
Development

No branches or pull requests

5 participants