Comments (7)
Hey, can you share the repo you are using. I am looking to reproduce this issue. Thank you.
from angular-web-bluetooth.
Just a +1 on the issue.
@manekinekko created a stackblitz, here.
It will tell You Can't find package:@manekinekko/angular-web-bluetooth
and offer You an "install button" - although it is already installed. Different behavior on stackblitz, but the result is the same.
error TS2307: Cannot find module '@manekinekko/angular-web-bluetooth' or its corresponding type declarations.
You can probably download the project to debug it.
Eager to get my hands dirty, if i can help You out in anyway, just let me know!
from angular-web-bluetooth.
Hey, can you share the repo you are using. I am looking to reproduce this issue. Thank you.
Hey @manekinekko, its a private repo I can't share it, but happy to provide any more info or code snippets. Thanks for your help and thanks @bitbay for putting up the stackblitz.
from angular-web-bluetooth.
λ node -v
v13.11.0
λ npm -v
6.13.7
And
λ ng version
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 11.2.2
Node: 13.11.0
OS: win32 x64
Angular: 11.2.3
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1102.2
@angular-devkit/build-angular 0.1102.2
@angular-devkit/core 11.2.2
@angular-devkit/schematics 11.2.2
@angular/cdk 11.2.2
@angular/cli 11.2.2
@angular/flex-layout 11.0.0-beta.33
@angular/material 11.2.2
@schematics/angular 11.2.2
@schematics/update 0.1102.2
rxjs 6.6.6
typescript 4.1.5
Then create project, add module
λ ng new bluetoothtest --commit false --defaults --minimal true --skip-git
λ cd bluetoothtest && npm install -S @manekinekko/angular-web-bluetooth @types/web-bluetooth
Just add import { WebBluetoothModule } from '@manekinekko/angular-web-bluetooth';
to app.module.ts
and
λ ng build
√ Browser application bundle generation complete.
Error: src/app/app.module.ts:5:36 - error TS2307: Cannot find module '@manekinekko/angular-web-bluetooth' or its corresponding type declarations.
5 import { WebBluetoothModule } from '@manekinekko/angular-web-bluetooth';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
But
λ ls node_modules\@manekinekko\
angular-web-bluetooth/
If You preferr start from sratch.
from angular-web-bluetooth.
DEFINITELY missed an important flag on project creation, --strict true
.
The correct command to get all them errors is
λ ng new bluetoothtest --commit false --defaults --minimal true --skip-git --strict true
Doing some monkeypatching, like
- adding the not recognized
node_modules/@types/web-bluetooth/*.d.ts
to theincludes
array insidetsconfig.app.json
(maybe solvable by defining this as a dependency inangular-web-bluetooth
?) - and fixing some obvious "strict" errors, while moving the package
@manekinekko/angular-web-bluetooth
into the projects src directly
I got down to
...
Error: src/app/src/lib/bluetooth.service.ts:385:36 - error TS2345: Argument of type 'BluetoothDevice' is not assignable to parameter of type 'FromEventTarget<Event>'.
Type 'BluetoothDevice' is not assignable to type 'HasEventTargetAddRemove<Event>'.
Types of property 'removeEventListener' are incompatible.
Type '(type: string, callback: EventListener | EventListenerObject | null, options?: boolean | EventListenerOptions | undefined) => void' is not assignable to type '(type: string, listener?: ((evt: Event) => void) | null | undefined, options?: boolean | EventListenerOptions | undefined) => void'.
Types of parameters 'callback' and 'listener' are incompatible.
Type '((evt: Event) => void) | null | undefined' is not assignable to type 'EventListener | EventListenerObject | null'.
Type 'undefined' is not assignable to type 'EventListener | EventListenerObject | null'.
385 const disconnected = fromEvent(characteristic.service.device, 'gattserverdisconnected');
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
Which seems like a mismatch of typedefs web-bluetooth and angulars compiler is using. Not a typedef guy myself, that's a bummer for me.
from angular-web-bluetooth.
This issues has been fixed in. Please install new version @manekinekko/[email protected]
. Please feel free to close this issue once you've confirmed it's working for you.
from angular-web-bluetooth.
Installed and working, thanks a lot @manekinekko
from angular-web-bluetooth.
Related Issues (20)
- Can't start project HOT 2
- Question: BluetoothCore extends Subject<BluetoothCore>? HOT 1
- Request: Make the service reusable for multiple components HOT 2
- Support batch mode. HOT 6
- Cannot find module '@manekinekko/angular-web-bluetooth' HOT 19
- Demo is not working on iOS safari HOT 2
- Number format from BLE scale HOT 1
- How can I send print job to bluetooth connected printer? HOT 2
- How can I subscribe to multiple services (via notify) ble simultaneously with a single click on the button? HOT 4
- Module is not Found HOT 6
- Performance improvement HOT 2
- Does not support on windows Chrome build 90. HOT 1
- How to get Temperature from BLE HOT 1
- Angular app cannot open in unsupported browser HOT 2
- Upgrade to Angular v12 - v13 HOT 3
- Support for Angular v15 HOT 1
- Can't add to a project with Angular 16 HOT 1
- Example does not work: MergeMap Errors HOT 1
- Support for Angular v17 HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-web-bluetooth.