Closed BrandonlinU closed 2 years ago
Well, it seems that after update the code from the repository, it seems that it release a more sinister bug, and after spend hours figure it out the problem in the Nuxt 3 playground I don't find any solution. Here is the trace:
[Vue warn]: inject() can only be used inside setup() or functional components. 16:11:27
[Vue warn]: Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build. 16:11:27
[Vue warn]: Unhandled error during execution of setup function 16:11:27
at <NuxtRoot>
[nuxt] [request error] [unhandled] [500] Cannot read properties of undefined (reading 'modules') 16:11:27
at _sfc_main.setup (./node_modules/.pnpm/nuxt@3.0.0_7ywvn3gtwfitf7f3hfntqq4vki/node_modules/nuxt/dist/app/components/nuxt-root.vue:67:16)
at callWithErrorHandling (./node_modules/.pnpm/@vue+runtime-core@3.2.45/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:157:22)
at setupStatefulComponent (./node_modules/.pnpm/@vue+runtime-core@3.2.45/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:7176:29)
at setupComponent (./node_modules/.pnpm/@vue+runtime-core@3.2.45/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:7131:11)
at renderComponentVNode (./node_modules/.pnpm/@vue+server-renderer@3.2.45_vue@3.2.45/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:172:17)
at renderToString (./node_modules/.pnpm/@vue+server-renderer@3.2.45_vue@3.2.45/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:450:26)
at Object.renderToString$1 [as renderToString] (./.nuxt/dev/index.mjs:3491:24)
at Object.renderToString (./node_modules/.pnpm/vue-bundle-renderer@1.0.0/node_modules/vue-bundle-renderer/dist/runtime.mjs:173:40)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ./.nuxt/dev/index.mjs:3551:21
[Vue warn]: inject() can only be used inside setup() or functional components. 16:11:27
[Vue warn]: Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build. 16:11:27
[Vue warn]: Unhandled error during execution of setup function 16:11:27
at <NuxtRoot>
[nuxt] [request error] [unhandled] [500] Cannot read properties of undefined (reading 'modules') 16:11:27
at _sfc_main.setup (./node_modules/.pnpm/nuxt@3.0.0_7ywvn3gtwfitf7f3hfntqq4vki/node_modules/nuxt/dist/app/components/nuxt-root.vue:67:16)
at callWithErrorHandling (./node_modules/.pnpm/@vue+runtime-core@3.2.45/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:157:22)
at setupStatefulComponent (./node_modules/.pnpm/@vue+runtime-core@3.2.45/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:7176:29)
at setupComponent (./node_modules/.pnpm/@vue+runtime-core@3.2.45/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:7131:11)
at renderComponentVNode (./node_modules/.pnpm/@vue+server-renderer@3.2.45_vue@3.2.45/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:172:17)
at renderToString (./node_modules/.pnpm/@vue+server-renderer@3.2.45_vue@3.2.45/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:450:26)
at Object.renderToString$1 [as renderToString] (./.nuxt/dev/index.mjs:3491:24)
at Object.renderToString (./node_modules/.pnpm/vue-bundle-renderer@1.0.0/node_modules/vue-bundle-renderer/dist/runtime.mjs:173:40)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ./.nuxt/dev/index.mjs:3551:21
Any idea?
I have added a temporary workaround until this gets fixed
devDependencies
"nuxt-windicss-monorepo": "fumeapp/nuxt-windicss-dist#dist",
"@windicss/plugin-utils": "^1.8.8",
"vite-plugin-windicss": "^1.8.8",
"windicss-analysis": "^0.3.5"
modules: [
...
'nuxt-windicss-monorepo/packages/nuxt-windicss',
...
],
Be sure to remove these extra deps when nuxt-windicss is fixed for v3 as they are already included
I have added a temporary workaround until this gets fixed
- Add the following to your
devDependencies
"nuxt-windicss-monorepo": "fumeapp/nuxt-windicss-dist#dist", "@windicss/plugin-utils": "^1.8.8", "vite-plugin-windicss": "^1.8.8", "windicss-analysis": "^0.3.5"
- Specify your module as this instead:
modules: [ ... 'nuxt-windicss-monorepo/packages/nuxt-windicss', ... ],
Be sure to remove these extra deps when nuxt-windicss is fixed for v3 as they are already included
No changes, Cannot start nuxt: nuxt.options.buildModules is not iterable
Fixed in 2.5.5, thanks @acidjazz
Thanks @acidjazz
Describe the bug After updating Nuxt 3 RC 13 to Nuxt 3.0.0, it does not allow define
buildModules
in the nuxt.config.ts, because it was deprecated. Because of that, when nuxt-windicss unpacks the array in the line 109, it throw an exception becausebuildModules
is now undefined.To Reproduce Steps to reproduce the behavior:
modules
section.Expected behavior It should not require
buildModules
in the nuxt.config.ts.Trace
Additional context It should be easy to fix this error, so I make a pull request and linked in to this issue.