Skip to content

Unable to access Pinia inside Routes.js file #13774

@AhmedHamdy-B

Description

@AhmedHamdy-B

Description

guys I am trying to use Pinia inside routes.js file and it says Pinia is not installed,
the routes gets compiled before the Pinia is initialized thats why I cant do that, and I cant reconfigure that as it is done under the hood by quasar. can anyone help?
my purpose is just to make a condition redirect for users in case there is something in the store that I will be checking with pinia. like if user is admin, and he goes to page X it is ok but if not it will redirect to other page etc...

image

image

image

Documentation Section URL

No response

Flavour

Quasar CLI with Webpack (@quasar/cli | @quasar/app-webpack)

Areas

Quasar CLI Commands/Configuration (@quasar/cli | @quasar/app-webpack | @quasar/app-vite), Plugins (quasar), SPA Mode

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions