bug: nuxt.config.js outputs config object with missing properties
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 285
- Forks
- 33
- Avg merge
- 22h 38m
- Merged PRs (30d)
- 3
Description
Environment
- Operating System:
Linux - Node Version:
v16.17.0 - Nuxt Version:
2.16.0-27720022.54e852f - Nitro Version:
1.0.0 - Package Manager:
npm@8.19.2 - Builder:
webpack - User Config:
modules,serverHandlers,devServerHandlers,devServer,typescript,bridge,buildModules - Runtime Modules:
normalizedModule() - Build Modules:
(),@nuxt/bridge@0.10.1
Reproduction
In an empty project
import { defineNuxtConfig } from 'nuxt/config' // replace with `@nuxt/bridge` in v2
import { defineNuxtModule, useNuxt } from '@nuxt/kit'
export default defineNuxtConfig({
modules: [
defineNuxtModule({
setup() {
const nuxt = useNuxt()
console.log(Object.keys(nuxt.options))
process.exit(0)
}
})
]
})
Describe the bug
I've made a diff between returned config from v2b and v3 and what I've got:
[
- 'ErrorPage',
- '__normalized__',
'_build',
- '_env',
- '_envConfig',
+ '_cli',
+ '_generate',
+ '_installedModules',
'_layers',
+ '_legacyGenerate',
+ '_majorVersion',
'_modules',
'_nuxtConfigFile',
'_nuxtConfigFiles',
+ '_prepare',
'_requiredModules',
+ '_start',
'alias',
'app',
- 'appTemplatePath',
- 'bridge',
+ 'appConfig',
+ 'appDir',
'build',
'buildDir',
- 'buildModules',
- 'cli',
- 'createRequire',
+ 'builder',
+ 'components',
'css',
'debug',
'dev',
'devServer',
'devServerHandlers',
'dir',
- 'editor',
- 'env',
- 'extendPlugins',
+ 'experimental',
+ 'extends',
'extensions',
- 'features',
- 'fetch',
'generate',
- 'globalName',
- 'globals',
- 'head',
'hooks',
'router',
- 'server',
+ 'runtimeConfig',
+ 'serverDir',
'serverHandlers',
- 'serverMiddleware',
+ 'sourcemap',
'srcDir',
'ssr',
- 'styleExtensions',
- 'target',
'telemetry',
'test',
+ 'theme',
'typescript',
+ 'vite',
'vue',
- 'vueMeta',
- 'watch',
- 'watchers'
+ 'watchers',
+ 'webpack',
+ 'workspaceDir'
]
The most painfull moment is the lack of runtimeConfug prop, as it used in nuxt-security, nuxt-auth, etc. nuxt-i18n is looking for vite prop, which is missing, too.
The modules above might have some other difficulties, that stops their bridge adoption, but the first step, in my opinion, is the definition of missing properties and (probably) marking some old props as deprecated.
Additional context
No response
Logs
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the nuxt.config.js reproduction and the defineNuxtModule/useNuxt entry points from @nuxt/kit. Compare the properties returned by the bridge configuration with the listed Nuxt 3 properties, especially runtimeConfig and vite, and review the linked module usages for compatibility requirements. Done means the missing configuration properties are available to bridge modules without breaking the existing configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nuxt, typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100