2

So as part of my news years resolution, I thought id build an app and I thought I would build it in vue.js and native script with a shared codebase, I've started with a fresh project and already I have an error, one that I've not caused, this is in router.js. see if you can spot it.

module.exports = (api, options) => {
require('@vue/cli-plugin-router/generator')(api, {
historyMode: options.routerHistoryMode
};
export default new Router(options);
}

When I've fixed the syntax error, I then get, the error:

/src/router.js: 'import' and 'export' may only appear at the top level (5:0)

This is when I run "npm run serve:ios"

if anyone has encountered this, please let me know how you fixed this.

Comments
  • 0
    Forgot the closing parantheses after require on line 4
  • 0
    You are runtime default exporting.. also I wouldnt cjs and es modules stay with one
Add Comment