Cannot read properties of undefined (reading 'modules')
See original GitHub issueEnvironment
- Operating System:
Darwin
- Node Version:
v16.14.0
- Nuxt Version:
3.0.0-rc.9
- Nitro Version:
0.5.0
- Package Manager:
npm@8.3.1
- Builder:
vite
- User Config:
-
- Runtime Modules:
-
- Build Modules:
-
Reproduction
- npx nuxi init nuxt-app
- cd nuxt-app
- npm install
- npm run dev
Error is thrown only when running on macbookβ¦
Describe the bug
Unable to run dev after fresh install on Macbook. However, doing npm run build, and npm run preview works without issue. Testing in stackblitz shows no issues however.
Additional context
Had no issues yesterday when doing fresh install of rc.9
Logs
gurpinder@Gurpinders-MacBook-Pro bug % npx nuxi init bug-test
Need to install the following packages:
nuxi
Ok to proceed? (y)
Nuxi 3.0.0-rc.9 22:28:53
βΉ cloned nuxt/starter#v3 to /Users/gurpinder/Desktop/bug/bug-test 22:28:54
22:28:54
Nuxi 3.0.0-rc.9 22:29:51
Nuxt 3.0.0-rc.9 with Nitro 0.5.0 22:29:51
22:29:54
> Local: http://localhost:3000/
> Network: http://192.168.0.106:3000/
βΉ Vite server warmed up in 171ms 22:29:55
β Nitro built in 185 ms nitro 22:29:55
βΉ Vite client warmed up in 701ms 22:29:55
[Vue warn]: inject() can only be used inside setup() or functional components.
[Vue warn]: Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.
[Vue warn]: Unhandled error during execution of setup function
at <NuxtRoot>
[nuxt] [request error] [unhandled] [500] Cannot read properties of undefined (reading 'modules')
at _sfc_main.setup (./node_modules/nuxt/dist/app/components/nuxt-root.vue:67:16)
at callWithErrorHandling (./node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:157:22)
at setupStatefulComponent (./node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:7107:29)
at setupComponent (./node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:7062:11)
at renderComponentVNode (./node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:172:17)
at renderToString (./node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:446:26)
at Object.renderToString$1 [as renderToString] (./.nuxt/dev/index.mjs:472:24)
at Object.renderToString (./node_modules/vue-bundle-renderer/dist/runtime.mjs:173:40)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async ./.nuxt/dev/index.mjs:521:21
[Vue warn]: inject() can only be used inside setup() or functional components.
[Vue warn]: Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.
[Vue warn]: Unhandled error during execution of setup function
at <NuxtRoot>
[Vue warn]: inject() can only be used inside setup() or functional components.
[Vue warn]: Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.
[Vue warn]: Unhandled error during execution of setup function
at <NuxtRoot>
Issue Analytics
- State:
- Created a year ago
- Reactions:8
- Comments:23 (10 by maintainers)
Top Results From Across the Web
javascript - TypeError: Cannot read properties of undefined ...
You are trying to iterate through the args array ( args.forEach() ) before var args exists. If you move var args = Message.content.split("Β ......
Read more >Uncaught TypeError Cannot read properties of undefined ...
Have you received Uncaught TypeError Cannot read properties of undefined reading Modules JavaScript client error on the page or in the browser console?...
Read more >Uncaught TypeError: Cannot read property of undefined In
Uncaught TypeError : Cannot read property of undefined error occurs in Chrome when you read a property or call a method on an...
Read more >Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError : Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >Uncaught TypeError: Cannot read properties of ... - DataTables
... TypeError: Cannot read properties of undefined (reading 'classes') at ./node_modules/datatables.net-bs4/js/dataTables.bootstrap4.mjsΒ ...
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
If it is a vue dependency issue, you could either add that package to your
build.transpile
or use yarn resolutions or npm overrides to force vue version.As this is also happening in https://github.com/sidestream-tech/sidebase, Iβve checked for different vue-versions there, and it looks like they are all the same: