Skip to content
This repository was archived by the owner on Sep 24, 2024. It is now read-only.
This repository was archived by the owner on Sep 24, 2024. It is now read-only.

fix: nuxt-content issue #6

@ktx-drashti

Description

@ktx-drashti

🐛 The bug

nuxt-full-static not working with @nuxt/content

I added @nuxt/content and got the error as below.

ERROR  Rollup error:  Unexpected token (Note that you need plugins to import files that are not JavaScript)
 at error (node_modules/rollup/dist/es/shared/rollup.js:1888:30)
 at Module.error (node_modules/rollup/dist/es/shared/rollup.js:12442:16)
 at Module.tryParse (node_modules/rollup/dist/es/shared/rollup.js:12819:25)
 at Module.setSource (node_modules/rollup/dist/es/shared/rollup.js:12724:24)
 at ModuleLoader.addModuleSource (node_modules/rollup/dist/es/shared/rollup.js:22166:20)

This is in Stackblitz.

I tried to use this in my current nuxt-3 project.

The error I got in the project is as below:

 ERROR  Cannot start nuxt:  nuxtCtx.tryUse is not a function                                                              11:28:24

  at useNuxt (/D:/MyProject/node_modules/nuxt/node_modules/@nuxt/kit/dist/index.mjs:48:28)
  at extendViteConfig (/D:/MyProject/node_modules/nuxt/node_modules/@nuxt/kit/dist/index.mjs:780:16)
  at addVitePlugin (/D:/MyProject/node_modules/nuxt/node_modules/@nuxt/kit/dist/index.mjs:806:3)
  at initNuxt (/D:/MyProject/node_modules/nuxt/dist/index.mjs:1443:3)
  at Object.ready (/D:/MyProject/node_modules/nuxt/dist/index.mjs:1421:18)
  at load (/D:/MyProject/node_modules/nuxi/dist/chunks/dev.mjs:6768:27)
  at async Object.invoke (/D:/MyProject/node_modules/nuxi/dist/chunks/dev.mjs:6813:5) 
  at async _main (/D:/MyProject/node_modules/nuxi/dist/cli.mjs:46:20)

nuxt.config.ts

import { defineNuxtConfig } from "nuxt";
export default defineNuxtConfig({
 modules: ["@nuxtjs/tailwindcss", "@nuxt/content", "nuxt-full-static],
})

package.json

{
  "devDependencies": {
    "@nuxt/content": "^2.0.1",
    "@nuxtjs/tailwindcss": "^5.3.0",
    "nuxt": "3.0.0-rc.6"
  },
}

🛠️ To reproduce

https://stackblitz.com/edit/github-p1mkc1?file=package.json

🌈 Expected behaviour

After adding nuxt-content module, it should work without any errors.

ℹ️ Additional context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions