The argument passed to the Object.keys method should be coerced to an object from ES2015 onward.
As illustrated in the example taken from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys.
// In ES5
Object.keys('foo'); // TypeError: "foo" is not an object
// In ES2015+
Object.keys('foo'); // ["0", "1", "2"]
However, this behaviour is not pollyfilled in Next.js for IE 11.
yarn dev or npm run dev to start the development serverIt should coerce the argument passed to Object.keys to object and not crash.
Could you please test this on next@canary?
I've just tested it and it's still broken on next@canary
Ooh, Object.keys exists in IE9 it seems. I do not believe we override existing browser globals to introduce new behavior. Let's take a deeper look into this though.
Yeah it exists but lacks the coercion functionality which was added as a part of the ES6 spec...
Most helpful comment
Ooh,
Object.keysexists in IE9 it seems. I do not believe we override existing browser globals to introduce new behavior. Let's take a deeper look into this though.