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?
what browser version are you using?
On Mon, Jun 6, 2016, 07:32 tangshiping [email protected] 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
https://github.com/rethinkdb/horizon/issues/566, or mute the thread
https://github.com/notifications/unsubscribe/AAAFVoYFbm0gtit90SoILem-BMwQRjItks5qJC9ngaJpZM4Iu9Yq
.
Ah, sorry I missed the title! Will have to check this out
I used VHiZR to test in Microsoft Internet Explorer 10.
The following functions are passed:
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?
Trying this out now...
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.
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.
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))
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.
The client tests are working in Microsoft Edge btw.
Object.assign is polyfillable. Add it to the consuming project and you should be good to go.
@duncanfinney How?
@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.
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 ..
Most helpful comment
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 ..