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

[Bug Report] [@vant/compat] Toast.loading() is not exported in @vant/compat #12952

Closed
upthen opened this issue Jun 20, 2024 · 0 comments · Fixed by #12953
Closed

[Bug Report] [@vant/compat] Toast.loading() is not exported in @vant/compat #12952

upthen opened this issue Jun 20, 2024 · 0 comments · Fixed by #12953

Comments

@upthen
Copy link
Contributor

upthen commented Jun 20, 2024

Reproduction Link

https://codesandbox.io/p/devbox/vant-4-issue-template-forked-w4kj65?workspaceId=12c348d7-7b7f-4d7b-b190-4ad4456c5cd1&layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522clxmm7pyt00073j6kcl61hqjp%2522%252C%2522sizes%2522%253A%255B60.355912743972446%252C39.644087256027554%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%2522%253A%2522clxmm7pyt00023j6kfy0ksnku%2522%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522SHELLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522id%2522%253A%2522clxmm7pyt00043j6kc96uhfv4%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522DEVTOOLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522id%2522%253A%2522clxmm7pyt00063j6kvibp3qd9%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%252C%2522sizes%2522%253A%255B50%252C50%255D%257D%252C%2522tabbedPanels%2522%253A%257B%2522clxmm7pyt00023j6kfy0ksnku%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clxmm7pyt00013j6k8ho4x9g2%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522FILE%2522%252C%2522filepath%2522%253A%2522%252Fsrc%252Findex.js%2522%252C%2522state%2522%253A%2522IDLE%2522%252C%2522initialSelections%2522%253A%255B%257B%2522startLineNumber%2522%253A4%252C%2522startColumn%2522%253A29%252C%2522endLineNumber%2522%253A4%252C%2522endColumn%2522%253A29%257D%255D%257D%252C%257B%2522id%2522%253A%2522clxmm96hi003c3j6ks6hmusj2%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522FILE%2522%252C%2522initialSelections%2522%253A%255B%257B%2522startLineNumber%2522%253A11%252C%2522startColumn%2522%253A21%252C%2522endLineNumber%2522%253A11%252C%2522endColumn%2522%253A21%257D%255D%252C%2522filepath%2522%253A%2522%252Fpackage.json%2522%252C%2522state%2522%253A%2522IDLE%2522%257D%255D%252C%2522id%2522%253A%2522clxmm7pyt00023j6kfy0ksnku%2522%252C%2522activeTabId%2522%253A%2522clxmm7pyt00013j6k8ho4x9g2%2522%257D%252C%2522clxmm7pyt00063j6kvibp3qd9%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clxmm7pyt00053j6kukj3ru2s%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TASK_PORT%2522%252C%2522taskId%2522%253A%2522dev%2522%252C%2522port%2522%253A8080%252C%2522path%2522%253A%2522%252F%2522%257D%255D%252C%2522id%2522%253A%2522clxmm7pyt00063j6kvibp3qd9%2522%252C%2522activeTabId%2522%253A%2522clxmm7pyt00053j6kukj3ru2s%2522%257D%252C%2522clxmm7pyt00043j6kc96uhfv4%2522%253A%257B%2522id%2522%253A%2522clxmm7pyt00043j6kc96uhfv4%2522%252C%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clxmm7pyt00033j6kngenompa%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TASK_LOG%2522%252C%2522taskId%2522%253A%2522dev%2522%257D%255D%252C%2522activeTabId%2522%253A%2522clxmm7pyt00033j6kngenompa%2522%257D%257D%252C%2522showDevtools%2522%253Atrue%252C%2522showShells%2522%253Atrue%252C%2522showSidebar%2522%253Atrue%252C%2522sidebarPanelSize%2522%253A15%257D

Vant Version

4.8.1

Describe the Bug

When I use @vant/compat for my vant upgrade, I import Toast from @vant/compat according to the offical docs upgrade guide,
And this error was throwed:

runtime-core.esm-bundler.js:220 Uncaught TypeError: vant_compat__WEBPACK_IMPORTED_MODULE_0_.Toast.loading is not a function
at Proxy.showLoading (App.vue:8:1)
at callWithErrorHandling (runtime-core.esm-bundler.js:158:1)
at callWithAsyncErrorHandling (runtime-core.esm-bundler.js:166:1)
at emit (runtime-core.esm-bundler.js:671:1)
at runtime-core.esm-bundler.js:7520:1
at onClick (Button.mjs:102:1)
at callWithErrorHandling (runtime-core.esm-bundler.js:158:1)
at callWithAsyncErrorHandling (runtime-core.esm-bundler.js:166:1)
at HTMLButtonElement.invoker (runtime-dom.esm-bundler.js:662:1)

I have read the source code, it seems to not been exported.
image
image

Reproduce Steps

reproduce it follow the following steps:

  • install vant@4.x and @vant/compat
  • import Toast from @vant/compat
  • use Toast.loading() in your code
  • view the console or the terminal
  • then you cloud see this error

Device / Browser

Microsoft Edge 版本 125.0.2535.92 (正式版本) (64 位)

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

Successfully merging a pull request may close this issue.

1 participant