Skip to content

Doesn't work in Nuxt.js (SSR) #36

@florian-lefebvre

Description

@florian-lefebvre

Please check all that apply

  • visual bug
  • functional bug
  • able to consistently reproduce

Expected Behavior

Importing Flagpack as a plugin should work.

Current Behavior

I get an error: Unexpected token '<'.

Possible Solution

This might be related with the SSR mode

Steps to Reproduce

  1. Create a nuxt project and select SSR mode, Node.js hosting
  2. yarn add vue-flagpack
  3. create plugins/vue-flagpack.js and paste Method A from the docs
  4. Add it in the plugins array in nuxt.config.js like: plugins: ["~/plugins/vue-flagpack.js"]

Screenshots

image

Logs

See screenshot.

Context

I'm trying to add flags to a lang switcher, based on @nuxtjs/i18n.

Your Environment

  • Version used: "vue-flagpack": "^1.0.1"
  • Browser Name and version: Opera GX (Opera 73)
  • Operating System and version (desktop or mobile): Windows 10 x64
  • Nuxt: "nuxt": "^2.14.12",
  • Link to your project: Private Gitlab repo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions