Home

Issue: 723

scrollBehavior - Syntax Error: Unexpected token

[issue link]

"nuxt": "^0.10.7"
nuxt.config.js:

router: {
    scrollBehavior: function (to, from, savedPosition) {
      return { x: 0, y: 0 }
    }
  },

gives me:

ERROR  Failed to compile with 1 errors                                                 18:07:50

 error  in ./.nuxt/router.js

Syntax Error: Unexpected token, expected ( (23:32)

  21 |
  22 |
> 23 | const scrollBehavior = function function(to, from, savedPosition) {
     |                                 ^
  24 |       return { x: 0, y: 0 };
  25 |     }
  26 |

Thanks for help,

This question is available on Nuxt.js community (#c618)