EddyVerbruggen / nativescript-nfc

:pencil: NativeScript plugin to discover, read, and write NFC tags
MIT License
85 stars 38 forks source link

Cannot add plugin for local build #57

Closed demetrius-tech closed 4 years ago

demetrius-tech commented 4 years ago

Hi,

OS: MacOS NativeScript: latest (platforms: 6.5.1, tns-core-modules: 6.5.5)

I am trying to add the plugin from an NativeScript angular project:

tns plugin add ../src

and it throws the following error on build:

tns build ios Preparing project... Hash: 6d5d3e256f940282df6d Version: webpack 4.27.1 Time: 6805ms Built at: 06/15/2020 21:32:52 4 assets Entrypoint bundle = runtime.js vendor.js bundle.js Entrypoint tns_modules/tns-core-modules/inspector_modules = runtime.js vendor.js tns_modules/tns-core-modules/inspector_modules.js [../$$_lazy_route_resource lazy recursive] ../$$_lazy_route_resource lazy namespace object 160 bytes {bundle} [built] [../../src/nfc.ts] /Users/demetrius.tech/dev/nativescript/nativescript-nfc/src/nfc.ts 927 bytes {bundle} [built] [failed] [1 error] [./app.css] 1.57 KiB {bundle} [built] [./app/app-routing.module.ts] 647 bytes {bundle} [built] [./app/app.component.html] 167 bytes {bundle} [built] [./app/app.component.ts] 379 bytes {bundle} [built] [./app/app.module.ts] 1.39 KiB {bundle} [built] [./app/main/main.component.html] 651 bytes {bundle} [built] [./app/main/main.component.ts] 4.27 KiB {bundle} [built] [./main.ts] 1.67 KiB {bundle} [built] [./package.json] 100 bytes {bundle} {tns_modules/tns-core-modules/inspector_modules} [optional] [built]

  • 600 hidden modules

ERROR in /Users/demetrius.tech/dev/nativescript/nativescript-nfc/src/nfc.ts Module build failed (from ../node_modules/@ngtools/webpack/src/index.js): Error: /Users/demetrius.tech/dev/nativescript/nativescript-nfc/src/nfc.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. at NativeScriptAngularCompilerPlugin.getCompiledFile (/Users/demetrius.tech/dev/nativescript/nativescript-nfc/demo-ng/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:933:23) at NativeScriptAngularCompilerPlugin.getCompiledFile (/Users/demetrius.tech/dev/nativescript/nativescript-nfc/demo-ng/node_modules/nativescript-dev-webpack/plugins/NativeScriptAngularCompilerPlugin.js:28:26) at /Users/demetrius.tech/dev/nativescript/nativescript-nfc/demo-ng/node_modules/@ngtools/webpack/src/loader.js:41:31 at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:97:5) @ ./app/main/main.component.ts 3:0-39 9:24-27 @ ./app/app.module.ts @ ./main.ts Executing webpack failed with exit code 2.

It works adding the nativescript-nfc plugin from the repository.

demetrius-tech commented 4 years ago

I had to include the ../src files in the angular project tnslint