Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected token at config #38

Open
JFGHT opened this issue Jul 30, 2019 · 1 comment
Open

Unexpected token at config #38

JFGHT opened this issue Jul 30, 2019 · 1 comment

Comments

@JFGHT
Copy link

JFGHT commented Jul 30, 2019

Describe the bug
It simply doesn't work after answering the questions.

Error: Line 14: Unexpected token ...
    at ErrorHandler.constructError (/home/user/.config/yarn/global/node_modules/esprima/dist/esprima.js:5012:22)
    at ErrorHandler.createError (/home/user/.config/yarn/global/node_modules/esprima/dist/esprima.js:5028:27)
    at Parser.unexpectedTokenError (/home/user/.config/yarn/global/node_modules/esprima/dist/esprima.js:1985:39)
    at Parser.throwUnexpectedToken (/home/user/.config/yarn/global/node_modules/esprima/dist/esprima.js:1995:21)
    at Parser.parseObjectPropertyKey (/home/user/.config/yarn/global/node_modules/esprima/dist/esprima.js:2499:33)
    at Parser.parseObjectProperty (/home/user/.config/yarn/global/node_modules/esprima/dist/esprima.js:2534:25)
    at Parser.parseObjectInitializer (/home/user/.config/yarn/global/node_modules/esprima/dist/esprima.js:2602:35)
    at Parser.inheritCoverGrammar (/home/user/.config/yarn/global/node_modules/esprima/dist/esprima.js:2285:37)
    at Parser.parsePrimaryExpression (/home/user/.config/yarn/global/node_modules/esprima/dist/esprima.js:2354:38)
    at Parser.inheritCoverGrammar (/home/user/.config/yarn/global/node_modules/esprima/dist/esprima.js:2285:37)

To Reproduce
Steps to reproduce the behavior:

  1. vue add prerender-spa
  2. Answer questions
  3. See error

Additional context
Vue version: 2.6.10
Vue CLI version: 3.9.3
OS: Ubuntu 19.04
Using typescript.

@SolarLiner SolarLiner modified the milestone: 1.2.0 Aug 14, 2019
@UstymUkhman
Copy link

UstymUkhman commented Sep 6, 2019

Same problem here using Windows 10 and TypeScript. Someone has a workaround, plz?

UPDATE: By setting custom configuration options in vue.config.js like explained here the plugin actually works, exept it generates an app.html file (from the main App component, I beleve) which does not include prerendered <meta> tags that are correctly injected into index.html. Maybe this could be avoided in vue.config.js..? Also, I'm missing .prerender-spa.json in the root directory of the project (which maybe wasn't generated because of this issue) and I have no idea what registry: undefined is used for.

My current setup:

pluginOptions: {
  lintStyleOnBuild: true,
  stylelint: {},

  prerenderSpa: {
    registry: undefined,
    renderRoutes: [
      '/',
      '/about'
    ],
    useRenderEvent: false,
    onlyProduction: true,

    headless: true,
    customRendererConfig: {
      args: ['--auto-open-devtools-for-tabs']
    }
  }
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants