Typescript error in boot files using store
Describe the bug
Property 'store' does not exist on type 'BootFileParams <any>'.ts(2339)
or if I pass a type to the template
Property 'store' does not exist on type 'BootFileParams <StateInterface>'.ts(2339)
Codepen/jsFiddle/Codesandbox (required or your issue may be closed)
To Reproduce quasar new boot newfile --format ts
then uncomment parameters and add 'store'
Here is as close as I could get it:
const callback: BootCallback<StateInterface> = async ({ app, store }) => {
await store.dispatch('auth/checkSession').catch(console.error)
}
export default boot(callback)
Here's a version I got to work without boot()
export default ({ app, store }: { app: App; store: Store<StateInterface> }) => {
store.dispatch('auth/checkSession').catch(console.error)
}
same with https://github.com/quasarframework/quasar/issues/8794
@metalsadman Thanks for the reference. Unfortunately, I verified the file and am still having the problem.
This time trying to make a navigation guard that uses store in /router/index.ts
My file looks like this file I found on github to verify against.
I also can't get the feature flag for ssr to work. 'quasar mode add ssr' creates the src-ssr directory with it's flag file, but neither the quasar typescript compiler, or vscode add the type.
So look, this same problem also appears here, in both VScode and quasar's compiler. Any other suggestions?
export default route(function ({ store })) { ... }
(parameter) store: any
'store' is declared but its value is never read.ts(6133)
Property 'store' does not exist on type '{}'.ts(2339)
@MichaelJCole did you ever figure out a solution?
My project has been working fine for months, but after a reboot I'm getting the same error even though store-flag.d.ts exists.
Hey, I think I'm still using the workaround.
On Wed, Apr 20, 2022, 8:20 AM Mark Lilback @.***> wrote:
@MichaelJCole https://github.com/MichaelJCole did you ever figure out a solution?
My project has been working fine for months, but after a reboot I'm getting the same error even though store-flag.d.ts exists.
— Reply to this email directly, view it on GitHub https://github.com/quasarframework/quasar/issues/11921#issuecomment-1103924381, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALPMFRTT27BUIVYEXZGYILVGAAB5ANCNFSM5LLDIZ7Q . You are receiving this because you were mentioned.Message ID: @.***>
Still running into this in 2024. Is there any fix?
The issue is still open...
4:69 error Unsafe argument of type anyassigned to a parameter of typePinia @typescript-eslint/no-unsafe-argument
Let's take a look at https://github.com/quasarframework/quasar/pull/17429 / @quasar/app-vite-v2.0.0-beta.19 Maybe it's fixed again.
Still an issue.
@MartinX3 can you provide a reproduction, please?
Have the same issue when upgrading from @quasar/app-vite 2.0.0-beta.15 to 2.0.0-beta.24
This is still an issue with SPA apps.
Had to delete node_modules and .quasar directories. You might want to add a note about this.
I have the same problem with a new project.
@jjjjose which command did you use to create the project, and which options did you choose during project creation? How can we reproduce the problem?
There was #17743 for app-webpack, it got fixed. So, this issue should not happen in new projects for app-vite/app-webpack.
To anyone still having a similar problem, we've dropped vuex support, that might be the reason. So, migrate your project accordingly or use it as a regular Vue plugin in a boot file. Thanks.