unplugin/unplugin-auto-import

Cannot access 'xxx' before initialization

baixiaoyu2997 opened this issue · 1 comments

Describe the bug

can'n start dev server, according to my tests, this problem is related to the composables/useContract function. It should be caused by the fact that useContract has the same name as the parameter in sdk/util/common.ts. When I try to delete default in useContract After that, this error will not occur.

error in console :

Uncaught ReferenceError: Cannot access 'commonOwner' before initialization
    at optionFactoryContract.ts:3:22
client.ts:103 [vite] server connection lost. polling for restart...

Reproduction

https://stackblitz.com/edit/vitejs-vite-ep9btn?file=src%2Fcomposables%2FuseContract.ts

test step:

  1. npm run dev
  2. check console

System Info

stackblitz

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.