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.

Getting warning: You are using a plugin with legacy Nuxt 2 format

See original GitHub issue

Reproduction

n/a

Steps to reproduce the bug

upgrade from nuxt rc4 to rc 5 6 7 or 8 using npx nuxi upgrade

yarn dev to spin up dev server

Expected behavior

no pinia errors

Actual behavior

when i start the dev serve i get this error:

[warn] [nuxt] You are using a plugin with legacy Nuxt 2 format (context, inject) which is likely to be broken. In the future they will be ignored: PiniaNuxtPlugin

and then while the website it running this error pops up on every page load:

[nuxt] [request error] [unhandled] [500] Cannot set properties of undefined (setting 'pinia')
  at PiniaNuxtPlugin (./.nuxt/dist/server/server.mjs:36760:31)  
  at ./.nuxt/dist/server/server.mjs:488:27  
  at fn (./.nuxt/dist/server/server.mjs:517:27)  
  at Object.callAsync (./node_modules/unctx/dist/index.mjs:49:19)  
  at callWithNuxt (./.nuxt/dist/server/server.mjs:519:23)  
  at applyPlugin (./.nuxt/dist/server/server.mjs:463:29)  
  at Module.applyPlugins (./.nuxt/dist/server/server.mjs:473:11)  
  at processTicksAndRejections (node:internal/process/task_queues:96:5)  
  at async createNuxtAppServer (./.nuxt/dist/server/server.mjs:46:7)  
  at async Object.renderToString (./node_modules/vue-bundle-renderer/dist/runtime.mjs:172:19)

Additional information

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
safejacecommented, Aug 16, 2022

@danielroe created the repro. so i think the issue, like you mentioned before was the @pinia/nuxt version.

package.json had ^0.1.8 and yarn.lock showed 0.1.9 was installed.

when making the repro it looked like 0.4.0 is the default now.

i am about to go test that for my local project, i guess my question is why npx nuxi upgrade didn’t also upgrade that? i worry that other packages i have might get stuck on old versions because of this

i suppose it was locked to 0.1.x cuz of the ^

1reaction
Teranodecommented, Aug 16, 2022

if you are still getting this add pinia to build.transpile

Read more comments on GitHub >

github_iconTop Results From Across the Web

0 - Stack Overflow
I had created the Nuxt project with the create-nuxt-app tool and then installed the packages with npm (7.23.0), and typescript failing to be ......
Read more >
dont work on nuxt rc.6 · Issue #584 - GitHub
6 and it returns the error "You are using a plugin with legacy Nuxt 2 format", even after putting proxyHeaders: false in nuxt.config....
Read more >
Plugins directory - Nuxt
Plugins directory. The plugins directory contains your Javascript plugins that you want to run before instantiating the root Vue.js Application.
Read more >
Vue and Nuxt Performance Optimization Checklist
When you are building a big application, you will get to a place where your project may have much more code than it...
Read more >
Nuxt 3 integration - Vue I18n - Intlify
The bundler for Nuxt 3 is vite by default. So we will use the vite option here for optimization. In vite.plugins , the...
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