nuxt-modules / prismic

Easily connect your Nuxt.js application to your content hosted on Prismic

Home Page:https://prismic.nuxtjs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not able to use the @nuxtjs/prismic@alpha release with Nuxt 3

exophunk opened this issue · comments

Versions

  • nuxt: Nuxt 3 latest (3.0.0-27501460.04a72f8)
  • @nuxtjs/prismic: 3.0.0-alpha.3
  • node: v16.13.1
  • npm: v8.6.0

Reproduction

Nuxt Config
import { defineNuxtConfig } from 'nuxt3'

export default defineNuxtConfig({
    modules: [
        '@nuxtjs/prismic',
    ],
    prismic: {
        endpoint: 'abc',
    }
})
package.json
{
  "private": true,
  "scripts": {
    "dev": "nuxi dev",
    "build": "nuxi build",
    "start": "node .output/server/index.mjs"
  },
  "devDependencies": {
    "@nuxtjs/prismic": "^3.0.0-alpha.3",
    "@nuxtjs/tailwindcss": "^5.0.2",
    "@pinia/nuxt": "^0.1.8",
    "@vueuse/nuxt": "^8.2.6",
    "nuxt3": "latest",
    "pinia": "^2.0.13"
  }
}

Steps to reproduce

  1. Install fresh Nuxt3 installation (npx nuxi init nuxt3-app)
  2. npm install --save-dev @nuxtjs/prismic@alpha according to Prismic Nuxt3 Alpha
  3. Run npm run dev

What is Expected?

Somewhat working application

What is actually happening?

When loading localhost:3000, an error is thrown:

[nuxt] [request error] Identifier 'exports' has already been declared
  at ESMLoader.moduleStrategy (node:internal/modules/esm/translators:139:18)  
  at ESMLoader.moduleProvider (node:internal/modules/esm/loader:236:14)  
  at async link (node:internal/modules/esm/module_job:67:21)

No issue when disabling prismic module. I don't get what I am doing wrong? Is it because some node version issue? v14 also did not work.

commented

Hey there, thank you for opening an issue and trying out Nuxt 3 with Prismic!

First of all, you're not doing anything wrong!

Now, as you might already know, Nuxt 3 is in beta and pending RC (https://v3.nuxtjs.org/community/roadmap). This makes our module likely to break as breaking changes are introduced by the Nuxt team in order to move faster towards a final release. This already happened a few times causing our module to be "out of sync" with Nuxt 3 latest state and breaking on its own as you experienced.

Anyway! As of writing this, the Nuxt team is in the process of releasing the first RC (nuxt/framework@4712e99), Nuxt 3 build is failing pretty much everywhere because of the name change, I'll work on stabilizing properly the module once the RC is out ☺️

Thanks for your patience 🙏

commented

Should be fixed in 3.0.0-alpha.5, let us know if anything ☺️