EddyVerbruggen / nativescript-taptic-engine

:vibration_mode: Use Apple's Taptic Engine to vibrate your iPhone 6s (and up) in a variety of ways
MIT License
18 stars 2 forks source link

Webpack issue #2

Closed patrickpereira closed 7 years ago

patrickpereira commented 7 years ago

Hi Eddy,

While trying to bundle with webpack, I'm getting the following error:

ERROR in ./pages/home/home.component.ts Module not found: Error: Can't resolve 'nativescript-taptic-engine' in '/Users/patrickpereira/lazy/K-cal/app/pages/home' @ ./pages/home/home.component.ts 10:0-58 @ ./pages/home/home.module.ngfactory.ts @ .. async @ ../~/@angular/core/src/linker/system_js_ng_module_factory_loader.js @ ./app.module.ngfactory.ts @ ./main.aot.ts

Works fine when I remove nativescript-taptic-engine. Any help to make this work?

EddyVerbruggen commented 7 years ago

Should be fine in 2.0.2, thanks for bringing this to my attention!

patrickpereira commented 7 years ago

Thanks for the swift action, I've updated and I'm still getting this:

ERROR in ./pages/home/home.component.ngfactory.ts Module not found: Error: Can't resolve 'nativescript-taptic-engine/taptic-engine.ios' in '/Users/patrickpereira/lazy/K-cal/app/pages/home' @ ./pages/home/home.component.ngfactory.ts 15:0-73 @ ./pages/home/home.module.ngfactory.ts @ .. async @ ../~/@angular/core/src/linker/system_js_ng_module_factory_loader.js @ ./app.module.ngfactory.ts @ ./main.aot.ts

ERROR in ./pages/home/home.component.ts Module not found: Error: Can't resolve 'nativescript-taptic-engine' in '/Users/patrickpereira/lazy/K-cal/app/pages/home' @ ./pages/home/home.component.ts 10:0-58 @ ./pages/home/home.module.ngfactory.ts @ .. async @ ../~/@angular/core/src/linker/system_js_ng_module_factory_loader.js @ ./app.module.ngfactory.ts @ ./main.aot.ts

PS. I'm using it in a lazyloaded module

EddyVerbruggen commented 7 years ago

Hmm.. if you look in platforms/ios/<appname>/app/tns_modules/<plugin>/package.json, does it show the updated version number?

patrickpereira commented 7 years ago

Yes it shows the updated number, since it only breaks when using webpack/aot, could it be something that would need to be changed in the tsconfig.aot.json file?

Mine currently looks like this:

{ "compilerOptions": { "target": "es5", "module": "es2015", "moduleResolution": "node", "sourceMap": false, "emitDecoratorMetadata": true, "experimentalDecorators": true, "removeComments": true, "noImplicitAny": false, "suppressImplicitAnyIndexErrors": true, "types": [], "baseUrl": ".", "paths": { "ui/": ["node_modules/tns-core-modules/ui/"], "platform": ["node_modules/tns-core-modules/platform"], "image-source": ["node_modules/tns-core-modules/image-source"], "xml": ["node_modules/tns-core-modules/xml"], "xhr": ["node_modules/tns-core-modules/xhr"], "text": ["node_modules/tns-core-modules/text"], "data": ["node_modules/tns-core-modules/data"], "fetch": ["node_modules/tns-core-modules/fetch"], "trace": ["node_modules/tns-core-modules/trace"], "fps-meter": ["node_modules/tns-core-modules/fps-meter"], "color": ["node_modules/tns-core-modules/color"], "application-settings": ["node_modules/tns-core-modules/application-settings"], "http": ["node_modules/tns-core-modules/http"], "camera": ["node_modules/tns-core-modules/camera"], "console": ["node_modules/tns-core-modules/console"], "timer": ["node_modules/tns-core-modules/timer"], "utils": ["node_modules/tns-core-modules/utils"], "location": ["node_modules/tns-core-modules/location"], "file-system": ["node_modules/tns-core-modules/file-system"], "application": ["node_modules/tns-core-modules/application"], "image-asset": ["node_modules/tns-core-modules/image-asset"], "connectivity": ["node_modules/tns-core-modules/connectivity"], "globals": ["node_modules/tns-core-modules/globals"] } }, "exclude": [ "node_modules", "platforms" ], "angularCompilerOptions": { "skipMetadataEmit": true, "genDir": "./" } }

EddyVerbruggen commented 7 years ago

I'm a total noob at webpack so dunno. Do you use any other plugins that do work?