Skip to content

Commit

Permalink
Update nuxt.md
Browse files Browse the repository at this point in the history
Because people keep running into vuejs#853 I'd suggest to include the troubleshoting directly inside the docs
  • Loading branch information
AloisSeckar authored Dec 29, 2022
1 parent dcf7ef0 commit 7bf4140
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/docs/ssr/nuxt.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@ export default defineNuxtConfig({

And that's it, use your store as usual!

### NPM dependency issue with Nuxt 3

As of late December 2022 there is a [known problem](https://github.com/vuejs/pinia/issues/853) that may emerge when running `npm install`. You may end up with following error:

```
ERESOLVE unable to resolve dependency tree
```

There is nothing actually wrong with the setup, the problem lies inside npm. However, you can easilly bypass it with adding the following into your `package.json`:

```js
"overrides": {
"vue": "latest"
}
```

## Using the store outside of `setup()`

If you want to use a store outside of `setup()`, remember to pass the `pinia` object to `useStore()`. We added it to [the context](https://nuxtjs.org/docs/2.x/internals-glossary/context) so you have access to it in `asyncData()` and `fetch()`:
Expand Down

0 comments on commit 7bf4140

Please sign in to comment.