Unexpected token '<' after adding PrimeVue to existing NUXT project

UI Components for Vue
Post Reply
theo1
Posts: 2
Joined: 19 Dec 2020, 15:19

23 Oct 2021, 14:40

I have a working Nuxt project based on Vue 2 and Tailwind and need to use some components from PrimeVue.

Took these steps (using yarn since the project has been using yarn not npm):

1) yarn add primevue@^2.6.0
2) yarn add primeicons
3) added this to modules of nuxt.config.js:

Code: Select all

[
       'primevue/nuxt', {
            theme: 'tailwind-light',
            ripple: true,
            components: ['PickList'],
            directives: ['Tooltip','Badge']
        }
]
 
When I run I get the unexpected token error. Once I delete this entry in nuxt.config.js, everything works. Alternate configuration using 'primevue' property also fails and reveals that this part is ok:

Code: Select all

modules: ['primevue/nuxt'],
but

Code: Select all

 primevue: {....} 
is where the problem is.

What could be wrong? If it helps, please find key parts of my package.json as follows:

Code: Select all

    "scripts": {
        "dev": "nuxt",
        "build": "nuxt build",
        "start": "nuxt start",
        "generate": "nuxt generate",
        "lint:js": "eslint --ext .js,.vue --ignore-path .gitignore .",
        "lint": "yarn lint:js"
    },
    "dependencies": {
        "@hcaptcha/vue-hcaptcha": "^0.2.3",
        "@heroicons/vue": "^1.0.4",
        "@nuxtjs/axios": "^5.12.2",
        "@nuxtjs/recaptcha": "^0.6.2",
        "@tailwindcss/ui": "^0.6.2",
        "core-js": "^3.6.5",
        "nuxt": "^2.14.6",
        "primeicons": "^4.1.0",
        "primevue": "^2.6.0",
        "vue-recaptcha": "^1.3.0",
        "vue-scrollto": "^2.20.0",
        "vuelidate": "^0.7.6"
    },
    "devDependencies": {
        "@hcaptcha/vue-hcaptcha": "^0.2.3",
        "@nuxtjs/eslint-config": "^3.1.0",
        "@nuxtjs/eslint-module": "^2.0.0",
        "@nuxtjs/google-fonts": "^1.1.3",
        "@nuxtjs/tailwindcss": "^3.1.0",
        "babel-eslint": "^10.1.0",
        "eslint": "^7.10.0",
        "eslint-plugin-nuxt": "^1.0.0"
    }


tugce.kucukoglu
Posts: 254
Joined: 23 Oct 2020, 09:28

16 Nov 2021, 15:01

Unable to replicate this. Could you please check this repo https://github.com/primefaces/primevue- ... quickstart?

If the issue persists, please provide us just a simple repo so that we can work on it again.

Thank you.

Post Reply

Return to “PrimeVue”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests