Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__vite_ssr_import_0__.xxx is not a function #26543

Open
baixiaoyu2997 opened this issue Mar 29, 2024 · 3 comments
Open

__vite_ssr_import_0__.xxx is not a function #26543

baixiaoyu2997 opened this issue Mar 29, 2024 · 3 comments

Comments

@baixiaoyu2997
Copy link
Contributor

baixiaoyu2997 commented Mar 29, 2024

Environment

stackblitz

Reproduction

https://stackblitz.com/edit/nuxt-starter-i3vypr?file=composables%2FuseContract.ts

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. This may also be related to the logic of auto-import.

Additional context

No response

Logs

500
__vite_ssr_import_0__.commonOwner is not a function

at ./sdk/ethereum/optionFactoryContract.ts:3:37
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ViteNodeRunner.runModule (/Users/l.rain/Documents/workspace/deorderbook-monorepo/node_modules/.pnpm/vite-node@1.4.0_@types+node@18.19.17/node_modules/vite-node/dist/client.mjs:362:5)
at async ViteNodeRunner.directRequest (/Users/l.rain/Documents/workspace/deorderbook-monorepo/node_modules/.pnpm/vite-node@1.4.0_@types+node@18.19.17/node_modules/vite-node/dist/client.mjs:346:5)
at async ViteNodeRunner.cachedRequest (/Users/l.rain/Documents/workspace/deorderbook-monorepo/node_modules/.pnpm/vite-node@1.4.0_@types+node@18.19.17/node_modules/vite-node/dist/client.mjs:189:14)
at async ViteNodeRunner.dependencyRequest (/Users/l.rain/Documents/workspace/deorderbook-monorepo/node_modules/.pnpm/vite-node@1.4.0_@types+node@18.19.17/node_modules/vite-node/dist/client.mjs:233:12)
at async ./store/wallet.ts:2:31
at async ViteNodeRunner.runModule (/Users/l.rain/Documents/workspace/deorderbook-monorepo/node_modules/.pnpm/vite-node@1.4.0_@types+node@18.19.17/node_modules/vite-node/dist/client.mjs:362:5)
at async ViteNodeRunner.directRequest (/Users/l.rain/Documents/workspace/deorderbook-monorepo/node_modules/.pnpm/vite-node@1.4.0_@types+node@18.19.17/node_modules/vite-node/dist/client.mjs:346:5)
at async ViteNodeRunner.cachedRequest (/Users/l.rain/Documents/workspace/deorderbook-monorepo/node_modules/.pnpm/vite-node@1.4.0_@types+node@18.19.17/node_modules/vite-node/dist/client.mjs:189:14)
Copy link

stackblitz bot commented Mar 29, 2024

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@manniL
Copy link
Member

manniL commented Mar 29, 2024

Most likely https://github.com/unjs/unimport -related as you mentioned.

Could you try reproducing it with "just that library"? 🙏🏻

@baixiaoyu2997
Copy link
Contributor Author

baixiaoyu2997 commented Apr 1, 2024

It seems like it's a bug from unimport, i created a issue: unplugin/unplugin-auto-import#481

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants