Skip to content

Quasar CLI Vite - use store in boot files #12793

@onurkose

Description

@onurkose

What happened?

app.use(store, storeKey) called after boot files initiated in client-entry.js
When plugins used with Pinia, they are initiated after app.use(store, storeKey) called.
The store parameter passed into the boot files can be used to initiate store modules but they don't provide plugins at this stage.

In this particular problem, the plugin is pinia-plugin-persistedstate-2

What did you expect to happen?

Plugins are available once store parameter passed to boot files once they are invoked.

Reproduction URL

https://codesandbox.io/s/goofy-galois-f4yhof

How to reproduce?

  1. Go to codesandbox link,
  2. Check store/index.js,
  3. Check boot/exampleBoot.js,
  4. Comment out to line 7 to disable app.use(store) call,
  5. exampleModuleStore.$persistedState will throw undefined message to console.

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

Quasar CLI Commands/Configuration (@quasar/cli | @quasar/app-webpack | @quasar/app-vite)

Platforms/Browsers

Chrome

Quasar info output

No response

Relevant log output

No response

Additional context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions