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

[500] nuxtAppCtx.tryUse is not a function #14680

Closed
cawa-93 opened this issue Aug 22, 2022 · 5 comments
Closed

[500] nuxtAppCtx.tryUse is not a function #14680

cawa-93 opened this issue Aug 22, 2022 · 5 comments

Comments

@cawa-93
Copy link
Contributor

cawa-93 commented Aug 22, 2022

Environment

  • Operating System: Windows_NT
  • Node Version: v16.14.0
  • Nuxt Version: 3.0.0-rc.8
  • Package Manager: npm@8.3.1
  • Builder: vite
  • User Config: typescript
  • Runtime Modules: -
  • Build Modules: -

Reproduction

  1. Clone repo and checkout to issue branch git clone --branch issue https://github.com/olena195/blog_kyivska_zefirka.git
  2. Install dependencies npm ci
  3. Run dev server npm run dev
  4. Open your dev URL http://localhost:3000/

Describe the bug

I got Internal Server Error and 2 errors in terminal:

[Vue warn]: Unhandled error during execution of setup function 
  at <NuxtRoot>                                                
[nuxt] [request error] [unhandled] [500] nuxtAppCtx.tryUse is not a function                                                           
  at Module.useNuxtApp (/C:/Users/kozac/Dev/blog_kyivska_zefirka/.nuxt/dist/server/server.mjs:446:38)                                  
  at setup (/C:/Users/kozac/Dev/blog_kyivska_zefirka/.nuxt/dist/server/server.mjs:3070:39)                                             
  at _sfc_main.setup (/C:/Users/kozac/Dev/blog_kyivska_zefirka/.nuxt/dist/server/server.mjs:3124:23)                                   
  at callWithErrorHandling (C:\Users\kozac\Dev\blog_kyivska_zefirka\node_modules\@vue\runtime-core\dist\runtime-core.cjs.js:157:22)    
  at setupStatefulComponent (C:\Users\kozac\Dev\blog_kyivska_zefirka\node_modules\@vue\runtime-core\dist\runtime-core.cjs.js:7084:29)  
  at setupComponent (C:\Users\kozac\Dev\blog_kyivska_zefirka\node_modules\@vue\runtime-core\dist\runtime-core.cjs.js:7039:11)          
  at renderComponentVNode (C:\Users\kozac\Dev\blog_kyivska_zefirka\node_modules\@vue\server-renderer\dist\server-renderer.cjs.js:172:17)
  at renderToString (C:\Users\kozac\Dev\blog_kyivska_zefirka\node_modules\@vue\server-renderer\dist\server-renderer.cjs.js:446:26)
  at Object.renderToString$1 [as renderToString] (/C:/Users/kozac/Dev/blog_kyivska_zefirka/.nuxt/dev/index.mjs:469:24)
  at Object.renderToString (/C:/Users/kozac/Dev/blog_kyivska_zefirka/node_modules/vue-bundle-renderer/dist/runtime.mjs:173:40)
[nitro] Error while generating error response FetchError: 500  (/__nuxt_error?url=/&statusCode=500&statusMessage=Internal+Server+Error&message=nuxtAppCtx.tryUse+is+not+a+function&description=%3Cpre%3E%3Cspan+class=%22sta
ck%22%3Eat+Module.useNuxtApp+(/C:/Users/kozac/Dev/blog_kyivska_zefirka/.nuxt/dist/server/server.mjs:446:38)%3C/span%3E%0A%3Cspan+class=%22stack%22%3Eat+setup+(/C:/Users/kozac/Dev/blog_kyivska_zefirka/.nuxt/dist/server/se
rver.mjs:3070:39)%3C/span%3E%0A%3Cspan+class=%22stack%22%3Eat+_sfc_main.setup+(/C:/Users/kozac/Dev/blog_kyivska_zefirka/.nuxt/dist/server/server.mjs:3124:23)%3C/span%3E%0A%3Cspan+class=%22stack+internal%22%3Eat+callWithE
rrorHandling+(C:%5CUsers%5Ckozac%5CDev%5Cblog_kyivska_zefirka%5Cnode_modules%5C@vue%5Cruntime-core%5Cdist%5Cruntime-core.cjs.js:157:22)%3C/span%3E%0A%3Cspan+class=%22stack+internal%22%3Eat+setupStatefulComponent+(C:%5CUs
ers%5Ckozac%5CDev%5Cblog_kyivska_zefirka%5Cnode_modules%5C@vue%5Cruntime-core%5Cdist%5Cruntime-core.cjs.js:7084:29)%3C/span%3E%0A%3Cspan+class=%22stack+internal%22%3Eat+setupComponent+(C:%5CUsers%5Ckozac%5CDev%5Cblog_kyi
vska_zefirka%5Cnode_modules%5C@vue%5Cruntime-core%5Cdist%5Cruntime-core.cjs.js:7039:11)%3C/span%3E%0A%3Cspan+class=%22stack+internal%22%3Eat+renderComponentVNode+(C:%5CUsers%5Ckozac%5CDev%5Cblog_kyivska_zefirka%5Cnode_mo
dules%5C@vue%5Cserver-renderer%5Cdist%5Cserver-renderer.cjs.js:172:17)%3C/span%3E%0A%3Cspan+class=%22stack+internal%22%3Eat+renderToString+(C:%5CUsers%5Ckozac%5CDev%5Cblog_kyivska_zefirka%5Cnode_modules%5C@vue%5Cserver-r
enderer%5Cdist%5Cserver-renderer.cjs.js:446:26)%3C/span%3E%0A%3Cspan+class=%22stack%22%3Eat+Object.renderToString$1+[as+renderToString]+(/C:/Users/kozac/Dev/blog_kyivska_zefirka/.nuxt/dev/index.mjs:469:24)%3C/span%3E%0A%
3Cspan+class=%22stack+internal%22%3Eat+Object.renderToString+(/C:/Users/kozac/Dev/blog_kyivska_zefirka/node_modules/vue-bundle-renderer/dist/runtime.mjs:173:40)%3C/span%3E%3C/pre%3E&data)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Object.errorhandler [as onError] (file:///C:/Users/kozac/Dev/blog_kyivska_zefirka/.nuxt/dev/index.mjs:354:16)
    at async Server.nodeHandler (file:///C:/Users/kozac/Dev/blog_kyivska_zefirka/node_modules/h3/dist/index.mjs:445:9)

Additional context

Same issue in WSL

Logs

No response

@danielroe
Copy link
Member

See #14538. This is caused by having an older version of unctx installed. You can typically resolve by running npx nuxi upgrade or otherwise upgrading your dependencies or refreshing your lockfile.

@JWPapi
Copy link

JWPapi commented Oct 13, 2022

Honestly the issue is that this project is drawing the wrong dependencies:

https://tailwindcss.nuxtjs.org/

I would recommend to follow this guide:

https://tailwindcss.com/docs/guides/nuxtjs

Copy link
Member

I don't think any of the package dependencies of @nuxtjs/tailwindcss should cause an issue, if you refresh your lockfile.

@JWPapi
Copy link

JWPapi commented Oct 13, 2022 via email

Copy link
Member

Thanks for the link.

@danielroe danielroe added the 3.x label Jan 19, 2023
@danielroe danielroe transferred this issue from nuxt/framework Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants