权限已开通。
app.json 已引入。
"logisticsPlugin": {
"version": "2.1.5",
"provider": "wx9ad912bf20548d92"
}
页面 index.js 按文档写法引入插件包:
var plugin = requirePlugin("logisticsPlugin")
Component({})
报以下错误:
页面【pages/order/index]错误:
Error: This application has not registered any plugins yet.
at WASubContext.js?t=wechat&s=1688143937582&v=2.31.0:1
at k (WASubContext.js?t=wechat&s=1688143937582&v=2.31.0:1)
at index.js:12
at WASubContext.js?t=wechat&s=1688143937582&v=2.31.0:1
at f.runWith (WASubContext.js?t=wechat&s=1688143937582&v=2.31.0:1)
at q (WASubContext.js?t=wechat&s=1688143937582&v=2.31.0:1)
at <anonymous>:8:5
at evaluateRes (asdebug.js:1)
at asdebug.js:1
at Object.invoke (asdebug.js:1)(env: macOS,mp,1.06.2306020; lib: 2.31.0)
Error: This application has not registered any plugins yet.
at WASubContext.js?t=wechat&s=1688143937582&v=2.31.0:1
at k (WASubContext.js?t=wechat&s=1688143937582&v=2.31.0:1)
at index.js:12
at WASubContext.js?t=wechat&s=1688143937582&v=2.31.0:1
at f.runWith (WASubContext.js?t=wechat&s=1688143937582&v=2.31.0:1)
at q (WASubContext.js?t=wechat&s=1688143937582&v=2.31.0:1)
at <anonymous>:8:5
at evaluateRes (asdebug.js:1)
at asdebug.js:1
at Object.invoke (asdebug.js:1)(env: macOS,mp,1.06.2306020; lib: 2.31.0)
app.js? [sm]:18 MiniProgramError
This application has not registered any plugins yet.
Error: This application has not registered any plugins yet.
at http://127.0.0.1:40663/appservice/__dev__/WASubContext.js?t=wechat&s=1688143937582&v=2.31.0:1:480939
at k (http://127.0.0.1:40663/appservice/__dev__/WASubContext.js?t=wechat&s=1688143937582&v=2.31.0:1:481006)
at weapp:///$pages/order/index.js:16:14
at http://127.0.0.1:40663/appservice/__dev__/WASubContext.js?t=wechat&s=1688143937582&v=2.31.0:1:485817
at f.runWith (http://127.0.0.1:40663/appservice/__dev__/WASubContext.js?t=wechat&s=1688143937582&v=2.31.0:1:475457)
at q (http://127.0.0.1:40663/appservice/__dev__/WASubContext.js?t=wechat&s=1688143937582&v=2.31.0:1:485795)
at <anonymous>:8:5
at evaluateRes (http://127.0.0.1:40663/appservice/__dev__/asdebug.js:1:93558)
at http://127.0.0.1:40663/appservice/__dev__/asdebug.js:1:10877
at Object.invoke (http://127.0.0.1:40663/appservice/__dev__/asdebug.js:1:12363)(env: macOS,mp,1.06.2306020; lib: 2.31.0)
开发者工具和 iOS 真机报错一致。
文档确实还需要完善。
已解决,是 app.json 写错了,改为下述写法问题解决:
"plugins": { "logisticsPlugin": { "version": "2.2.28", "provider": "wx9ad912bf20548d92" } }
物流组件的文档对我这种首次使用插件的来说很不友好。
反观插件的文档就写得很棒,如果一开始就看插件的文档就好了。
2024年5月了,这个文档还没更新好,第一次用插件踩了坑。
幸好在发现有问题的时候,直接看到了这篇。。。