我创建了一个离子项目(版本:4.0.6)。从https://beta.ionicframework.com/docs/native/social-sharing添加插件cordova-plugin-x-socialsharing后,我出现以下错误 。我被困在这里。有人可以帮我吗。
index.js:413 Uncaught TypeError: Object(...) is not a function
at index.js:413
at Object../node_modules/@ionic-native/social-sharing/index.js (index.js:590)
at __webpack_require__ (bootstrap:81)
at Object../src/app/app.module.ts (app.global.ts:10)
at __webpack_require__ (bootstrap:81)
at Object../src/main.ts (environment.ts:15)
at __webpack_require__ (bootstrap:81)
at Object.0 (main.ts:12)
at __webpack_require__ (bootstrap:81)
at checkDeferredModules (bootstrap:43)
Run Code Online (Sandbox Code Playgroud)
更新:我今天找到了一个解决方案!步骤1:将package.json中的插件版本更改为package.json中显示的@ ionic-native / core相同版本。步骤2:删除node_module并运行npm install。第三步:在导入时,在末尾添加“ / ngx”,如下所示;从“ @ ionic-native / social-sharing / ngx”导入{SocialSharing};步骤4:与离子2或离子3一样休息
| 归档时间: |
|
| 查看次数: |
579 次 |
| 最近记录: |