search

Home  >  Q&A  >  body text

node.js - Error: Object.assign is not a function. How to solve it?

1, index.html code

2. Entry app.js code

3. Error message

Error: Uncaught TypeError: Object.assign is not a function
How to solve it?

phpcn_u1582phpcn_u15822696 days ago1313

reply all(2)I'll reply

  • 为情所困

    为情所困2017-07-06 10:38:27

    Your browser is too old and does not support this method. Object.assign seems to be a method only available in es6. Solution: introduce babel/ployfill

    $ npm install babel-core --save-dev
    import 'babel-core/polyfill'

    reply
    0
  • 女神的闺蜜爱上我

    女神的闺蜜爱上我2017-07-06 10:38:27

    You can refer to this:
    http://babeljs.io/docs/usage/...

    reply
    0
  • Cancelreply