\r\n \u003Cbr/>\r\n\r\n \u003Cp>The problem is: \u003Cbr/>\r\n - If you navigate directly to this page, the data is set.\u003Cbr/>\r\n - If you navigate to this page from the home page, the data is NOT set. \r\n \u003Cstrong>That's the bug!\u003C/strong>\r\n \u003C/p>\r\n\r\n \u003Cp>\r\n \u003Cnuxt-link to=\"/\">Home\u003C/nuxt-link>\r\n \u003C/p>\r\n \u003C/main>\r\n\u003C/template>\r\n\r\n\u003Cscript setup>\r\nimport { storeToRefs } from \"pinia\";\r\nimport { useExampleStore } from \"~/stores/example\";\r\n\r\nconst exampleStore = useExampleStore();\r\n\r\nconst { getData } = exampleStore;\r\nconst { fruits } = storeToRefs(exampleStore);\r\n\r\nconst { data, pending, error } = useAsyncData(\"get-fruits\", getData);\r\nconsole.log(\">>> THIS IS SET: data.value\", data.value)\r\nconsole.log(\">>> THIS IS **NOT** SET when navigating from /: fruits.value\", fruits.value)\r\n\r\n// debugging payload\r\n// payload still shows the landing page when this is triggered, so the payload was not updated either\r\nonMounted(() => {\r\n const { payload } = useNuxtApp();\r\n //console.log(\"> >>> Payload: \", payload);\r\n console.log(\"> >>> Payload path >>> \", payload.path);\r\n});\r\n \u003C/script>\r\n```\r\n\r\n### Describe the bug\r\n\r\n#### The bug: \r\n- If you start navigation from `/`, then click the nuxt-link to `/fruits`, the pinia store is empty.\r\n- If you start directly at `/fruits` or reload the page, the pinia store is hydrated correctly.\r\n\r\n#### Expected behavior: \r\nFor the payload to hydrate the pinia store in both cases: Navigating directly to `/fruits` page (same as reloading the page), vs starting at root `/` then navigating to `/fruits` page. The should both hydrate the store.\r\n\r\n#### Also noticed: useNuxtApp().payload does not update between page changes. \r\nIt remains stuck at the first page loaded, in this example `/` will be the payload loaded, not `/fruits`.\r\n\r\n\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Logs\r\n\r\n```shell-script\r\nConsole output when you start at `/` then navigate to `/fruits by clicking the link`:\r\n\r\n>>> THIS IS SET: data.value \r\nProxy { \u003Ctarget>: {…}, \u003Chandler>: {…} }\r\n>>> THIS IS **NOT** SET when navigating from /: fruits.value \r\nArray [] \u003C-- the should have 3 fruits!\r\n> >>> Payload path >>> / \u003C-- Notice, the payload.path still `/`\r\n\r\n---\r\n\r\nConsole output when reloading directly `/fruits/`:\r\n\r\n>>> THIS IS SET: data.value \r\nProxy { \u003Ctarget>: {…}, \u003Chandler>: {…} }\r\n>>> THIS IS **NOT** SET when navigating from /: fruits.value \u003C-- 3 fruits, correct\r\nProxy { \u003Ctarget>: (3) […], \u003Chandler>: {…} }\r\n> >>> Payload path >>> /fruits \u003C--- it's correct\r\n```\r\n",[2927,2928],{"name":2867,"color":2868},{"name":2870,"color":2871},23800,"Bug using useAsyncData with ssr: true. Pinia not updated from payload.","2023-11-15T12:56:11Z","https://github.com/nuxt/nuxt/issues/23800",0.712635,{"description":2935,"labels":2936,"number":2939,"owner":2873,"repository":2873,"state":2874,"title":2940,"updated_at":2941,"url":2942,"score":2943},"### Environment\n\n- Operating System: Linux\r\n- Node Version: v16.20.0\r\n- Nuxt Version: 3.7.2\r\n- CLI Version: 3.8.3\r\n- Nitro Version: 2.6.3\r\n- Package Manager: npm@9.4.2\r\n- Builder: -\r\n- User Config: modules, nitro, runtimeConfig\r\n- Runtime Modules: @pinia/nuxt@0.4.11\r\n- Build Modules: \n\n### Reproduction\n\nhttps://stackblitz.com/edit/github-bwuqrs\n\n### Describe the bug\n\nIn my personal project, I have to do two requests on the server side. For this, I was using useAsyncData, making one request, and after it, doing another with the data of the previous request. \r\n\r\nit worked normally when I was using direct axios service. However, when I created a plugin for $api and injected it in the nuxt context, the second request started to throw an error: **A composable that requires access to the Nuxt instance was called outside of a plugin, Nuxt hook, Nuxt middleware, or Vue setup function**.\r\n\r\nI do these requests inside pinia store, calling useNuxtApp().$api inside of the store, for each request.\r\n\r\nExample of **useAsyncData**:\r\n```\r\nawait useAsyncData('initStore', async () => {\r\n if (process.server) {\r\n const settingsStore = useSettingsStore();\r\n // Change condition to works\r\n if (true) {\r\n await settingsStore.get();\r\n await settingsStore.get();\r\n } else {\r\n console.log('No error');\r\n await Promise.allSettled([settingsStore.get(), settingsStore.get()]);\r\n }\r\n }\r\n});\r\n```\r\n\r\n**Pinia store:** \r\n```\r\nexport const useSettingsStore = defineStore('settingsStore', {\r\n state: () => ({}),\r\n actions: {\r\n async get() {\r\n try {\r\n const { $api } = useNuxtApp();\r\n console.log('$api passed');\r\n } catch (err) { \r\n console.log('error inside catch', err);\r\n } \r\n },\r\n },\r\n});\r\n```\r\n\r\nDo I have to instantiate useNuxtApp inside useAsyncData and pass it to actions inside pinia? Why the second request is throwing this error? Is there a solution for that?\r\n\r\nPs.: If I do both requests at the same time, It works normally, the nuxt context inside pinia works.\r\n\r\n\r\n\r\n\r\n\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell-script\nError: [nuxt] A composable that requires access to the Nuxt instance was called outside of a plugin, Nuxt hook, Nuxt middleware, or Vue setup function. This is probably not a Nuxt bug. Find out more at `https://nuxt.com/docs/guide/concepts/auto-imports#using-vue-and-nuxt-composables`.\n```\n",[2937,2938],{"name":2867,"color":2868},{"name":2870,"color":2871},23192,"Call useNuxtApp two times in pinia store inside useAsyncData - Nuxt context instance error","2023-09-13T22:49:03Z","https://github.com/nuxt/nuxt/issues/23192",0.71326005,{"description":2945,"labels":2946,"number":2949,"owner":2873,"repository":2873,"state":2874,"title":2950,"updated_at":2951,"url":2952,"score":2953},"### Environment\n\n- Operating System: Darwin\r\n- Node Version: v18.16.0\r\n- Nuxt Version: 3.6.1\r\n- Nitro Version: 2.5.1\r\n- Package Manager: npm@9.4.0\r\n- Builder: vite\r\n- User Config: modules, imports\r\n- Runtime Modules: @pinia/nuxt@0.4.11\r\n- Build Modules: -\n\n### Reproduction\n\nhttps://stackblitz.com/edit/nuxt-starter-vibihh?file=pages%2Findex.vue,store%2Fwallet.ts\n\n### Describe the bug\n\nI want to modify the value of `isSetOption` to `true` in the `wallet store` by listening to the completion of asynchronous operations in the `chain store`. However, the final result is `false`, and there is no operation in my code to set `isSetOption.value` to `false`.\n\n### Additional context\n\nAlthough the maintainers of Pinia have provided me with a [solution](https://github.com/vuejs/pinia/issues/2285#issuecomment-1612535520) to this issue, I am not sure if it is a bug in Nuxt. So, if this is not a bug, feel free to close the issue.\n\n### Logs\n\n_No response_",[2947,2948],{"name":2867,"color":2868},{"name":2870,"color":2871},21858,"watching asynchronous data can lead to inconsistent values in the store","2023-06-29T08:28:17Z","https://github.com/nuxt/nuxt/issues/21858",0.71331203,{"description":2955,"labels":2956,"number":2962,"owner":2873,"repository":2873,"state":2874,"title":2963,"updated_at":2964,"url":2965,"score":2966},"### Environment\r\n\r\nNuxi 3.4.3 Node Version 16.10.0\r\n---- NUXT CONFIG ----\r\n```ts\r\nexport default defineNuxtConfig({\r\n modules: ['@pinia/nuxt', '@nuxt/ui'],\r\n ssr: false,\r\n router: {\r\n middleware: ['layout'],\r\n },\r\n layouts: {\r\n // Specify the default layout for all pages\r\n default: '~/layouts/default.vue',\r\n },\r\n runtimeConfig: {\r\n // The private keys which are only available within server-side\r\n apiSecret: '123',\r\n // Keys within public, will be also exposed to the client-side\r\n public: {\r\n },\r\n },\r\n pinia: {\r\n autoImports: [\r\n // automatically imports `defineStore`\r\n 'defineStore', // import { defineStore } from 'pinia'\r\n ['defineStore', 'definePiniaStore'], // import { defineStore as definePiniaStore } from 'pinia'\r\n ],\r\n },\r\n components: {\r\n path: '~/components',\r\n extensions: ['.vue'],\r\n pathPrefix: false,\r\n global: true,\r\n },\r\n vite: {\r\n css: {\r\n preprocessorOptions: {\r\n scss: {\r\n additionalData: '@import \"@/assets/styles/main.scss\";',\r\n },\r\n },\r\n },\r\n },\r\n publicRuntimeConfig: {\r\n apiURL: process.env.NUXT_API || '',\r\n },\r\n buildModules: [\r\n // Simple usage\r\n '@nuxtjs/dotenv',\r\n ],\r\n plugins: [{ src: './alert.plugin' }]\r\n});\r\n```\r\n---- package.json-----\r\n```json\r\n{\r\n \"private\": true,\r\n \"scripts\": {\r\n \"build\": \"nuxt build\",\r\n \"dev\": \"nuxt dev\",\r\n \"generate\": \"nuxt generate\",\r\n \"preview\": \"nuxt preview\",\r\n \"postinstall\": \"nuxt prepare\"\r\n },\r\n \"devDependencies\": {\r\n \"@nuxt/ui\": \"^0.3.3\",\r\n \"nuxt\": \"^3.2.3\",\r\n \"postcss\": \"^8.4.21\",\r\n \"prettier\": \"2.8.4\",\r\n \"sass\": \"^1.58.3\",\r\n \"sass-loader\": \"^13.2.0\",\r\n \"tailwindcss\": \"^3.2.7\"\r\n },\r\n \"dependencies\": {\r\n \"@coinbase/wallet-sdk\": \"^3.6.4\",\r\n \"@gnosis.pm/safe-apps-provider\": \"^0.15.1\",\r\n \"@gnosis.pm/safe-apps-sdk\": \"^7.8.0\",\r\n \"@mobiscroll/javascript\": \"^5.22.2\",\r\n \"@nuxt/kit\": \"^3.4.3\",\r\n \"@nuxtjs/dotenv\": \"^1.4.1\",\r\n \"@pinia/nuxt\": \"^0.4.7\",\r\n \"@vueform/multiselect\": \"^2.6.1\",\r\n \"@vuepic/vue-datepicker\": \"^5.0.1\",\r\n \"@vueup/vue-quill\": \"^1.1.1\",\r\n \"@walletconnect/ethereum-provider\": \"^2.7.2\",\r\n \"@walletconnect/web3-provider\": \"^1.8.0\",\r\n \"axios\": \"^1.3.4\",\r\n \"chart.js\": \"^3.9.1\",\r\n \"element-plus\": \"^2.3.4\",\r\n \"ethers\": \"^5.6.9\",\r\n \"flowbite\": \"^1.6.3\",\r\n \"nuxt3\": \"^3.5.0-28064087.90ab1b50\",\r\n \"pinia\": \"^2.0.33\",\r\n \"quill\": \"^1.3.7\",\r\n \"vee-validate\": \"^4.7.4\",\r\n \"vue\": \"^3.3.2\",\r\n \"vue-chart-3\": \"^3.1.8\",\r\n \"vue-dapp\": \"^0.7.2\",\r\n \"vue-demi\": \"^0.13.11\",\r\n \"vue-icomoon\": \"^0.6.1\"\r\n }\r\n}\r\n```\r\n\r\n### Reproduction\r\n\r\nAfter npm i get this error\r\n> npm i \r\n> postinstall\r\n> nuxt prepare\r\n\r\nNuxi 3.4.3 7:13:04 PM\r\n\r\n ERROR Cannot set properties of undefined (setting 'default') 7:13:39 PM\r\n\r\n at build (node_modules/nuxt3/dist/index.mjs:3210:21)\r\n at buildNuxt (node_modules/@nuxt/kit/dist/index.mjs:563:12)\r\n at async Object.invoke (node_modules/nuxi/dist/chunks/prepare.mjs:39:5)\r\n at async _main (node_modules/nuxi/dist/cli.mjs:48:20)\r\n\r\n\r\n### Describe the bug\r\n\r\nAfter the update, I can't start the procester and reinstall node-modules, started getting an error.\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Logs\r\n\r\n```shell-script\r\n> postinstall\r\n> nuxt prepare\r\n\r\nNuxi 3.4.3 7:13:04 PM\r\n\r\n ERROR Cannot set properties of undefined (setting 'default') 7:13:39 PM\r\n\r\n at build (node_modules/nuxt3/dist/index.mjs:3210:21)\r\n at buildNuxt (node_modules/@nuxt/kit/dist/index.mjs:563:12)\r\n at async Object.invoke (node_modules/nuxi/dist/chunks/prepare.mjs:39:5)\r\n at async _main (node_modules/nuxi/dist/cli.mjs:48:20)\r\n\r\nnpm ERR! code 1\r\nnpm ERR! path /Users/artem/WebstormProjects/talentum_talents_front_end\r\nnpm ERR! command failed\r\nnpm ERR! command sh -c nuxt prepare\r\n\r\nnpm ERR! A complete log of this run can be found in:\r\nnpm ERR! /Users/artem/.npm/_logs/2023-05-12T17_13_39_562Z-debug.log\r\n```\r\n",[2957,2958,2959],{"name":2867,"color":2868},{"name":2870,"color":2871},{"name":2960,"color":2961},"needs reproduction","FBCA04",20818,"Cannot set properties of undefined (setting 'default') ","2023-05-12T17:55:54Z","https://github.com/nuxt/nuxt/issues/20818",0.7137005,{"description":2968,"labels":2969,"number":2971,"owner":2873,"repository":2873,"state":2874,"title":2972,"updated_at":2973,"url":2974,"score":2975},"### Environment\n\n------------------------------\n- Operating System: Darwin\n- Node Version: v22.14.0\n- Nuxt Version: 3.17.1\n- CLI Version: 3.25.0\n- Nitro Version: 2.11.11\n- Package Manager: npm@11.1.0\n- Builder: -\n- User Config: compatibilityDate, app, devtools, ssr, modules, pinia, vite\n- Runtime Modules: @nuxt/test-utils@3.17.2, @pinia/nuxt@0.11.0\n- Build Modules: -\n------------------------------\n\n### Reproduction\n\nAfter installing the Pinia module and creating a new store and plugin, use the following code:\n\nAs [Pinia docs](https://pinia.vuejs.org/ssr/#Using-the-store-outside-of-setup-) to use the store outside setup(), we need to pass the context to the store function as an argument:\n\n```ts\nexport default defineNuxtPlugin(async ({ $pinia, vueApp }) => {\n // Weird behavior\n const pinia_old = $pinia // type: unknown\n const pinia = vueApp.$nuxt.$pinia // type: Pinia\n})\n```\n\n### Describe the bug\n\nThe strange thing is that the correct type is recognized inside nuxtApp.vueApp.$nuxt.$pinia but not in nuxtApp.$pinia, even though it exists.\n\nYou can solve this issue with type casting:\n\n```ts\nexport default defineNuxtPlugin(async ({ $pinia }) => {\n const pinia = $pinia as Pinia\n const configStore = useConfigStore(pinia)\n})\n```\n\nMeanwhile, this works well in Nuxt 2! It correctly inherits the type in the context.\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell-script\n\n```",[2970],{"name":2870,"color":2871},32055,"Pinia unknown type on NuxtPlugin","2025-05-09T11:09:48Z","https://github.com/nuxt/nuxt/issues/32055",0.7143015,["Reactive",2977],{},["Set"],["ShallowReactive",2980],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$f8yoGAhmrn8-2Cy33G7A_h_kgbBVkHTMBtlihLuX2ZgA":-1},"/nuxt/ui/3452"]