You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error: Exported variable 'useMainStore' has or is using name 'StoreWithState' from external module "/Users/steven/Documents/New Documents Dec 2020/boilerplate/versiontwo/node_modules/pinia/dist/pinia" but cannot be named.ts(4023)
Steps to reproduce the behavior
Installed pinia@next and added it to main.ts and created a new file with the example code.
import{defineStore}from"pinia";exportconstuseMainStore=defineStore({// name of the store// it is used in devtools and allows restoring stateid: "main",// a function that returns a fresh statestate: ()=>({counter: 0,name: "Eduardo",}),// optional gettersgetters: {doubleCount(){returnthis.counter*2;},// use getters in other gettersdoubleCountPlusOne(){returnthis.doubleCount*2;},},// optional actionsactions: {reset(){// `this` is the store instancethis.counter=0;},},});
The text was updated successfully, but these errors were encountered:
Hey @posva I copied the code provided in the read me to an existing project. I've added my relevant code / the two files I changed to my first comment. Although in order to provide a full repo I'd have to provide my entire project.
I am also using Vuex and was planning to transition over to Pinia. (not sure if that matters)
Any advice to what I could try or what the error means would be great! Very excited to get this working.
Exported variable 'useMainStore' has or is using name 'StoreWithState' from external module ".../versiontwo/node_modules/pinia/dist/pinia" but cannot be named.
My file structure is set up as
Main folder <-- I's looking for Pinia here in the main (/versiontwo/node_modules/)
Packages
-- Frontend
--- node_modules <-- Pinia is installed here (/versiontwo/packages/frontend/node_modules/)
Note: I have VSCode set to hide Node modules folders but each package folders has it's own node modules.
Reproduction
Error:
Exported variable 'useMainStore' has or is using name 'StoreWithState' from external module "/Users/steven/Documents/New Documents Dec 2020/boilerplate/versiontwo/node_modules/pinia/dist/pinia" but cannot be named.ts(4023)
Steps to reproduce the behavior
Installed pinia@next and added it to main.ts and created a new file with the example code.
main.ts
piniaStore.ts
The text was updated successfully, but these errors were encountered: