question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'Version' of undefined.

See original GitHub issue

Version

Windows 10.

"@nuxtjs/strapi": "1.3.1"
"nuxt3": "latest"      // nuxt3@3.0.0-27495976.e31c604

Steps to reproduce

Create new Nuxt project from npx nuxi init Add nuxtjs/strapi v1.3.2 Add strapi to build modules and this config object:

  // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
  buildModules: [
    '@nuxtjs/strapi'
  ],

  strapi: {
    url: 'http://localhost:1337',
    version: 'v3'
  },

What is Expected?

That nuxt will build and run.

What is actually happening?

Build finishes without error, but the page render fails with the error:

Nuxt CLI v3.0.0-27495976.e31c604                                                                                                                                                                                                           12:51:19
                                                                                                                                                                                                                                           12:51:19
  > Local:    http://localhost:4000/ 
  > Network:  http://172.19.80.1:4000/
  > Network:  http://192.168.1.144:4000/

i Vite client warmed up in 6571ms                                                                                                                                                                                                          12:51:33
i Vite server warmed up in 4235ms                                                                                                                                                                                                          12:51:37
√ Vite server built in 8449ms                                                                                                                                                                                                              12:51:42
√ Nitro built in 474 ms                                                                                                                                                                                                              nitro 12:51:42
[nitro] [request error] Cannot read property 'version' of undefined
  at Module.useStrapiUrl (/C:/projects/perfectit/spikes/PerfectitWebNuxt3/.nuxt/dist/server/server.mjs:3507:33)  
  at Module.useStrapiAuth (/C:/projects/perfectit/spikes/PerfectitWebNuxt3/.nuxt/dist/server/server.mjs:3617:37)  
  at /C:/projects/perfectit/spikes/PerfectitWebNuxt3/.nuxt/dist/server/server.mjs:10044:47  
  at fn (/C:/projects/perfectit/spikes/PerfectitWebNuxt3/.nuxt/dist/server/server.mjs:478:27)  
  at Object.callAsync (/C:/projects/perfectit/spikes/PerfectitWebNuxt3/node_modules/unctx/dist/index.mjs:41:19)  
  at callWithNuxt (/C:/projects/perfectit/spikes/PerfectitWebNuxt3/.nuxt/dist/server/server.mjs:480:23)  
  at applyPlugin (/C:/projects/perfectit/spikes/PerfectitWebNuxt3/.nuxt/dist/server/server.mjs:435:29)  
  at Module.applyPlugins (/C:/projects/perfectit/spikes/PerfectitWebNuxt3/.nuxt/dist/server/server.mjs:445:11)  
  at async createNuxtAppServer (/C:/projects/perfectit/spikes/PerfectitWebNuxt3/.nuxt/dist/server/server.mjs:44:7)  
  at async renderToString (/C:/projects/perfectit/spikes/PerfectitWebNuxt3/node_modules/vue-bundle-renderer/dist/index.mjs:247:19)
i nuxt.config.ts updated. Restarting nuxt...                                                                                                                                                                                               12:59:52
√ Vite server built in 6091ms    

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
benjamincanaccommented, Apr 13, 2022

You can use the edge channel with latest changes: https://strapi.nuxtjs.org/setup#edge-channel

1reaction
benjamincanaccommented, Apr 13, 2022

Hey @FieldMarshallVague,

Thanks for reporting this!

The issue was caused by a breaking change in nuxt3:

The linked pull request should fix that, let me know if you still have the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'version' of undefined #2866 - GitHub
If it's yarn serve or npm run serve , then it's because eslint is not added to your project (I don't see it...
Read more >
Cannot read property 'version' of undefined Vue.js - Stack ...
From my experience it may happen if there is import of package.json in one of your project's files, but with incorrect path. Usually,...
Read more >
TypeError: Cannot read property 'version' of undefined
TypeError : Cannot read property 'version' of undefined ... Just do npm install eslint inside the project. It should work. [ad_2]. Content Protection...
Read more >
TypeError: Cannot read property 'version' of undefined : r/vuejs
TypeError : Cannot read property 'version' of undefined. out of nowhere, I tried to serve my website and I got this error:
Read more >
TypeError: Cannot read property 'version' of undefined - telebit.js
TypeError : Cannot read property 'version' of undefined #56 ... Possible solution: Not sure but it seems like a bug in the config...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found