我已经创建了一个ionic项目(版本: 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)更新:今天我找到了一个解决方案!step1:将package.json中的插件版本更改为与package.json中显示的@ionic-native/core相同的版本。步骤2:删除node_module并运行npm install。Step 3:导入时在末尾添加'/ngx‘,从’@ ionic -native/social-sharing/ngx‘导入{ SocialSharing };step 4: rest同ionic 2或ionic 3
发布于 2019-02-06 21:11:29
现在,将从@ionic-native/plugin-xxx/ngx导入Angular版本。
https://stackoverflow.com/questions/51856853
复制相似问题