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
I’m confused. After installing vite-plugin-circular-dependency, I noticed a lot of circular dependencies.
I did this because I was facing Cannot access '...' before initialization errors, I know this is because circular dependencies problem, so I installed the plugin.
src/handlers/exchange-status-handler.ts
src/handlers/exchange-status-handler.ts ( actually it's using router.push api ) -> src/router/index.ts -> src/router/modules/transfer.ts -> src/views/transfer/transfer-status.vue -> src/handlers/exchange-status-handler.ts
I think some modules rely on the router for navigation, but the router typically has many modules, and these modules define paths. Paths, in turn, import Vue pages, which contain a lot of logic. It’s quite normal for the page to depend on some modules, and for those modules to rely on the router, to get currentRoute or navigation.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
This discussion was converted from issue #534 on April 26, 2025 16:42.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Related plugins
plugin-vue
plugin-vue-jsx
Describe the bug
I’m confused. After installing vite-plugin-circular-dependency, I noticed a lot of circular dependencies.
I did this because I was facing
Cannot access '...' before initialization
errors, I know this is because circular dependencies problem, so I installed the plugin.I think some modules rely on the router for navigation, but the router typically has many modules, and these modules define paths. Paths, in turn, import Vue pages, which contain a lot of logic. It’s quite normal for the page to depend on some modules, and for those modules to rely on the router, to get currentRoute or navigation.
Reproduction
https://github.com/latel/vite-circular-dependencies-router
Steps to reproduce
pnpm i
pnpm build
System Info
Used Package Manager
pnpm
Logs
Validations
Beta Was this translation helpful? Give feedback.
All reactions