Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"useRuntimeConfig is not defined" after upgrading to v5.2.0 #140

Closed
matt-clegg opened this issue Apr 27, 2023 · 3 comments
Closed

"useRuntimeConfig is not defined" after upgrading to v5.2.0 #140

matt-clegg opened this issue Apr 27, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@matt-clegg
Copy link

matt-clegg commented Apr 27, 2023

Version

nuxt-directus v5.2.0
nuxt: v3.4.2

Steps to reproduce

I was previously running v5.1.3, I just upgraded to v5.2.0 and now my nuxt app is no longer working and is throwing an error on startup.

What is actually happening?

The following error is thrown on the server:

[nuxt] [request error] [unhandled] [500] useRuntimeConfig is not defined
   at Module.useDirectusToken (./node_modules/nuxt-directus/dist/runtime/composables/useDirectusToken.mjs:8:34)  
   at Module.useDirectus (./node_modules/nuxt-directus/dist/runtime/composables/useDirectus.mjs:10:43)  
   at Module.useDirectusAuth (./node_modules/nuxt-directus/dist/runtime/composables/useDirectusAuth.mjs:11:42)  
   at Object.setup (./node_modules/nuxt-directus/dist/runtime/plugin.mjs:10:49)  
   at wrapper (./node_modules/nuxt/dist/app/nuxt.js:198:21)  
   at fn (./node_modules/nuxt/dist/app/nuxt.js:214:27)  
   at Object.callAsync (./node_modules/unctx/dist/index.mjs:68:55)  
   at callWithNuxt (./node_modules/nuxt/dist/app/nuxt.js:216:23)  
   at applyPlugin (./node_modules/nuxt/dist/app/nuxt.js:129:29)  
   at Module.applyPlugins (./node_modules/nuxt/dist/app/nuxt.js:139:11)

and in the browser:
image

@matt-clegg matt-clegg added the bug Something isn't working label Apr 27, 2023
@NeekoDev
Copy link

NeekoDev commented Apr 27, 2023

I can confirm this bug too.

nuxt-directus : 5.2.0
nuxt : 3.4.2
directus : 9.26.0

@casualmatt
Copy link
Collaborator

I'm checking

@casualmatt
Copy link
Collaborator

The bug is present just when the module is built, not in the playground, and now I understand why we didn't see it.

@casualmatt casualmatt self-assigned this Apr 27, 2023
casualmatt added a commit that referenced this issue Apr 27, 2023
@Intevel Intevel closed this as completed Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants