When running `nuxt/content` in RC 10 I get a server error
See original GitHub issueEnvironment
- Operating System:
Darwin
- Node Version:
v16.17.0
- Nuxt Version:
3.0.0-rc.10
- Nitro Version:
0.5.3
- Package Manager:
npm@8.15.0
- Builder:
vite
- User Config:
-
- Runtime Modules:
-
- Build Modules:
-
Reproduction
I sadly cannot provide a reproduction link, as the project is internal. However here is my package.json:
{
"private": true,
"engines": {
"node": ">=16.14.2",
"npm": ">=8.5.0"
},
"scripts": {
"dev": "nuxi dev",
"build": "nuxi build",
"start": "NODE_ENV=production node .output/server/index.mjs",
"lint": "npm-run-all lint:*",
"lint:types": "nuxi typecheck",
"lint:style": "eslint .",
"test": "npm-run-all postinstall && TZ=UTC vitest --run",
"test:watch": "npm-run-all postinstall && TZ=UTC vitest",
"test:ui": "npm-run-all postinstall && TZ=UTC vitest --ui",
"prepare": "husky install",
"postinstall": "nuxi prepare",
"story": "histoire dev",
"story:build": "histoire build",
"generate": "nuxi generate && rm -rf docs && mv .output/public docs && touch docs/.nojekyll && cp CNAME docs/"
},
"dependencies": {
"@fortawesome/fontawesome-free": "^6.2.0",
"@sidestream-tech/nuxt-sidebase-parse": "^0.2.6",
"@vueuse/core": "^9.2.0",
"aos": "^2.3.4",
"sqlite3": "^5.1.1",
"typeorm": "^0.3.9"
},
"devDependencies": {
"@antfu/eslint-config-vue": "^0.26.3",
"@babel/core": "^7.18.2",
"@faker-js/faker": "^7.5.0",
"@histoire/plugin-nuxt": "^0.10.7",
"@histoire/plugin-vue": "^0.10.7",
"@nuxt/content": "^2.1.1",
"@nuxtjs/tailwindcss": "^5.3.2",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/vue": "^6.6.1",
"@types/aos": "^3.0.4",
"@types/node": "^18.7.18",
"@types/supertest": "^2.0.12",
"@typescript-eslint/eslint-plugin": "^5.36.1",
"@typescript-eslint/parser": "^5.36.1",
"@vitejs/plugin-vue": "^3.0.3",
"@vitest/coverage-c8": "^0.23.2",
"@vitest/ui": "^0.23.2",
"ant-design-vue": "^3.2.12",
"babel-loader": "^8.2.4",
"eslint": "^8.23.0",
"eslint-plugin-tailwindcss": "^3.6.2",
"eslint-plugin-vue": "^9.4.0",
"histoire": "^0.10.7",
"husky": "^8.0.1",
"jsdom": "^20.0.0",
"lint-staged": "^13.0.1",
"npm-run-all": "^4.1.5",
"nuxt": "^3.0.0-rc.10",
"sass": "^1.54.9",
"supertest": "^6.2.4",
"unplugin-auto-import": "^0.11.2",
"unplugin-vue-components": "^0.22.4",
"vite-plugin-eslint": "^1.8.1",
"vite-svg-loader": "^3.5.1",
"vitest": "^0.23.2",
"vue": "^3.2.38",
"vue-loader": "^17.0.0",
"vue-tsc": "^0.40.9"
},
"lint-staged": {
"*{.js,.ts,.vue}": "eslint --fix ."
}
}
And my Nuxt Config:
import { isProduction } from './helpers'
// Needed to keep `ant-design-vue` running as of latest RC.8, see https://github.com/nuxt/framework/issues/6941#issuecomment-1229739856
const transpile = ['lodash-es']
if (isProduction) {
// For production build via rollup, we need to also transpile babel
transpile.push('@babel/runtime')
}
// https://v3.nuxtjs.org/docs/directory-structure/nuxt.config
export default defineNuxtConfig({
// Needed to keep `ant-design-vue` running as of latest RC.8, see https://github.com/nuxt/framework/issues/6941#issuecomment-1229739856
alias: {
dayjs: 'dayjs/esm/',
},
css: ['/assets/style.css', '@fortawesome/fontawesome-free/css/all.min.css', 'aos/dist/aos.css'],
typescript: {
// We enable `Volar Takeover Mode`, so we can disable the shim `*.vue` generation
// see https://v3.nuxtjs.org/getting-started/introduction#prerequisites
shim: false,
strict: true,
},
build: {
transpile,
},
modules: ['@nuxt/content', '@nuxtjs/tailwindcss'],
})
Describe the bug
After adding nuxt/content
to my project and including it in the nuxt.config.ts
file I get the following error when starting the project with npm run dev
.
ERROR [worker reload] [worker init] Named export 'postprocess' not found. The requested module 'file:///node_modules/micromark/lib/postprocess.js' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'file:///node_modules/micromark/lib/postprocess.js';
const { postprocess } = pkg;
import { postprocess } from 'node_modules/micromark/lib/postprocess.js';
^^^^^^^^^^^
SyntaxError: Named export 'postprocess' not found. The requested module 'node_modules/micromark/lib/postprocess.js' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'node_modules/micromark/lib/postprocess.js';
const { postprocess } = pkg;
at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:189:5)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:533:24)
at async loadESM (node:internal/process/esm_loader:91:5)
at async handleMainPromise (node:internal/modules/run_main:65:12)
Additional context
No response
Logs
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:7 (2 by maintainers)
Top Results From Across the Web
v3.0.0-rc.10 · Discussion #7513 · nuxt/framework - GitHub
Im getting this error when building: ✓ Server built in 23430ms 22:01:33 ✓ Generated public .output/public nitro 22:01:33 ℹ Initializing prerenderer nitro ...
Read more >Nuxt 3 impossible to run dev - Stack Overflow
For some reason i cannot start a nuxt project. you can find the error message i get when i do an "npm run...
Read more >Announcing Nuxt 3 Release Candidate
Nuxt 3 beta was announced on October 12, 2021 after 16 months of work, introducing a new foundation based on Vue 3, Vite...
Read more >@nuxtjs/apollo - npm
Start using @nuxtjs/apollo in your project by running `npm i @nuxtjs/apollo`. There are 23 other projects in the npm registry using ...
Read more >Dependencies | nuxt | npm - Open Source Insights
arrow_right @nuxt/babel‑preset‑app. 2.15.7 Notes Relation Licenses
Version 2.15.7 Published June 14, 2021 Description
arrow_right @nuxt/builder. 2.15.7 Notes Relation Licenses
Version 2.15.7 Published June 14, 2021
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Have your tried to clean install dependencies by removing
yarn.lock
/package-lock.json
?This is likely happening because of conflict in
micromark
version. I’ve tried to create simple project with your dependencies andnuxt.config
, everything works fine.I was doing some more investigation and saw that the package
@antfu/eslint-config-vue
also used micromark, however a older version. After removing the package to ensure only the new version is used I received a new error message: