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

Horizon client runs in Microsoft Internet Explorer(version 10) is failed #566

Open
tangshiping opened this issue Jun 6, 2016 · 13 comments
Labels
Milestone

Comments

@tangshiping
Copy link

tangshiping commented Jun 6, 2016

Using the F12 developer tool to watch the error logs, I saw some error messages printed in console like "Object.assign can't be supported"

Is there anyone see the same error?

@deontologician
Copy link
Contributor

what browser version are you using?

On Mon, Jun 6, 2016, 07:32 tangshiping notifications@github.com wrote:

Using the F12 developer tool to watch the error logs, I saw some error
messages printed in console like "Object.assign can't be supported"

Is there anyone encounter the same error?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#566, or mute the thread
https://github.com/notifications/unsubscribe/AAAFVoYFbm0gtit90SoILem-BMwQRjItks5qJC9ngaJpZM4Iu9Yq
.

@deontologician
Copy link
Contributor

Ah, sorry I missed the title! Will have to check this out

@BITDM
Copy link

BITDM commented Jun 12, 2016

I used VHiZR to test in Microsoft Internet Explorer 10.

The following functions are passed:

  • list all collections
  • retrieve docs in collection

But operations like insert, remove, update are all failed. The error is located in this line:

var options = Object.assign({}, this._query, { data: (0, _serialization.serialize)(wrappedDocs) });

SCRIPT438: 对象不支持“assign”属性或方法。I googled "Object.assign" and found this method is not supported in MS IE 10.

I was wondering if there are other ways to do the same thing?

@danielmewes
Copy link
Member

Trying this out now...

@BITDM
Copy link

BITDM commented Jun 13, 2016

There are some discussions on stackoverflow about the Object.assign. They also give the solution to use this method in browsers like MS IE 10: polyfill.

I check out the source code of horizon client. And I find this file: index-polyfill.js. It seems that polyfill has been used in the client, but actually it has no effect in IE 10.

@danielmewes
Copy link
Member

I ran the Horizon client tests with IE 10 and got two different errors:

"before each" hook for "sets a token and retrieves it back" 
ReferenceError: 'Map' is undefined
   at FakeStorage (test.js:47262:6)
   at Anonymous function (test.js:47136:8)
   at callFn (test.js:4728:6)
   at run (test.js:4721:8)
   at next (test.js:5063:6)
   at Anonymous function (test.js:5085:6)
   at timeslice (test.js:12852:6)

and

◾Allows iterating over the entire collection
Error: no Promise impl found
   at forEach (horizon.js:1741:14)
   at Anonymous function (test.js:45826:8)
   at callFnAsync (test.js:4748:6)
   at run (test.js:4703:8)
   at runTest (test.js:5187:6)
   at Anonymous function (test.js:5294:8)
   at next (test.js:5107:8)
   at Anonymous function (test.js:5117:8)
   at next (test.js:5049:8)
   at Anonymous function (test.js:5085:6)

insert, remove etc. actually appeared to work fine @BITDM have you tried using the Horizon functions directly without VHiZR? I wonder if the Object.assign might actually be used from there without a polyfill.

@BITDM
Copy link

BITDM commented Jun 13, 2016

I made a mistake that the version of IE is 11, not 10.

I tested horizon in a web app written by myself. This time when I retrieve a document, it stopped at this statement:

var query = Object.assign({}, previousQuery, options);

This statement is defined in this block:

var Order = exports.Order = function (_TermBase6) {
  (0, _inherits3.default)(Order, _TermBase6);

   function Order(sendRequest, previousQuery, fields, direction) {
   ....

It comes from the horizon client code.

This is my code:

db('menus').order('pos').limit(20).watch().subscribe((docs) => {
  console.log(docs)
},
(err) => console.log(err))

@arthurvi
Copy link

arthurvi commented Jul 20, 2016

Any progress on this? I get the same error on IE 11.

Object doesn't support property or method 'assign'

Edit: I have found a workaround:

Install core-js for a polyfill

npm install --save core-js

In your entry js file on top, add the following line:

require('core-js/fn/object/assign');

But I think we shouldn't need a polyfill to support Internet Explorer 11. We should add the polyfill in the horizon client.

@danielmewes
Copy link
Member

The client tests are working in Microsoft Edge btw.

@deontologician deontologician modified the milestones: Long term plans, Medium term plans Aug 2, 2016
@duncanfinney
Copy link

Object.assign is polyfillable. Add it to the consuming project and you should be good to go.

@BITDM
Copy link

BITDM commented Aug 6, 2016

@duncanfinney How?

@zalmoxisus
Copy link

zalmoxisus commented Aug 6, 2016

@BITDM,

Install object-assign and include

const objectAssign = require('object-assign');
Object.assign = objectAssign;

in your index.js. Or just include babel-polyfill, which will do the same, but also will add other polyfills.

Of course, better if horizon client lib would use babel's transform-object-assign plugin or the runtime plugin.

@sjmcdowall
Copy link

sjmcdowall commented Aug 7, 2016

Another solution that maybe more elegant is using polyfill.io's browser's include at the top of your main html file..

<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>

The advantage is that the above will only Polyfill what's needed (i.e. missing) from the browser the user is running.. so if it has support then no extra code, etc.

Just an idea.. got this from @wesbos and his new (quite nice) course on ES6 ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants