Comments (19)
Describe the bug
The module can't be found using the command
import { BluetoothCore } from '@manekinekko/angular-web-bluetooth'
Even if I get the right version (9.1.0) using the command
npm info @manekinekko/angular-web-bluetooth version
To Reproduce
npm i -S @manekinekko/angular-web-bluetooth @types/web-bluetooth
Within a component I add
import { WebBluetoothModule } from '@manekinekko/angular-web-bluetooth';
Running ng s, I get this error
ERROR in src/app/app.component.ts:2:31 - error TS2307: Cannot find module '@manekinekko/angular-web-bluetooth'.
import { BluetoothCore } from '@manekinekko/angular-web-bluetooth';
src/app/app.module.ts:6:36 - error TS2307: Cannot find module '@manekinekko/angular-web-bluetooth'.
Desktop (please complete the following information):
- OS: Windows 10 & Ubuntu 18.04
- Angular 8 & 9
from angular-web-bluetooth.
Hi, same problem for me. Angular 9.1.0 on Mac Catalina 10.15.4
from angular-web-bluetooth.
from angular-web-bluetooth.
@manekinekko thanks! confirming this works. appreciate the responsiveness here :)
from angular-web-bluetooth.
Hi, would you mind using the issue template so we can have more details on how to reproduce this issue?
from angular-web-bluetooth.
FYI, both packages are available on NPM...
from angular-web-bluetooth.
Ok, I'll use the template... FYI, it worked with v7.0.0
from angular-web-bluetooth.
I have the same issue, just starting a new project and try to import the library to replicate the problem. I checked out the sample code and there works fine but I also see the folder structure is a little different and also you have the PATH property in tsconfig.json of the example.
Tested with angular 9
from angular-web-bluetooth.
Same to me. Angular 9
from angular-web-bluetooth.
After migrating a project from 7.0.0 to 9.1.0 this issues is happening there at well...
from angular-web-bluetooth.
Running the bluetooth starter directly from a clone of this repo seems to work fine, but I get this issue when adding it to my own project.
error TS2307: Cannot find module '@manekinekko/angular-web-bluetooth'.
11 import { BluetoothCore } from '@manekinekko/angular-web-bluetooth';
error TS2307: Cannot find module '@manekinekko/angular-web-bluetooth'.
110 import { WebBluetoothModule } from '@manekinekko/angular-web-bluetooth';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ERROR in app/app.module.ts(210,5): Error during template compile of 'AppModule'
Could not resolve @manekinekko/angular-web-bluetooth relative to [object Object]..
@types/web-bluetooth is functioning correctly as the type definitions can be used with no problem. There must be something additional that needs to be done with the new angular.
from angular-web-bluetooth.
Same problem using yarn add with 9.1.0. Looking at the installed folder, it seems like the library code prior to build is being provided rather than the distribution ready code. Listing the directory at node_modules/@maneikinekko/angular-web-bluetooth
gives:
.release-it.json
README.md
karma.conf.js
ng-package.json
package.json
src/
tsconfig.lib.json
tsconfig.spec.json
tslint.json
from angular-web-bluetooth.
I bump into the same issue. Is there already a solution to this problem?
from angular-web-bluetooth.
@Express85 I worked around the problem by cloning the Git repository, then manually adding the build output as a library to my project.
from angular-web-bluetooth.
same issue for me as well. using node version 14.4.
Tried installing, ununistalling the npm package, getting some different errors.
Any workaround please?
also @stephen-dirtcreative can you please share the build output that you are mentioning with some steps.
from angular-web-bluetooth.
@ankiitbansal Sure, or at least I'll try.
What I did:
- Clone the repo: git clone https://github.com/manekinekko/angular-web-bluetooth.git
npm install
andnpm audit
-- The 2 high severity vulnerabilities were fixable, at least on my platform,npm audit fix
picked off 7 of 10 low vulnerabilities, also. I didn't attempt to address the remaining low vulnerabilities as they had to do with karma, protractor, and angular-buildnpm run prebuild
-- This is the script in package.json for building the library project, it should output to[repo root]/dist/manekinekko/angular-web-bluetooth
- Copy the
manekinekko
folder that was created under[repo root]/dist
to your Angular project'sdist
folder. - Edit your tsconfig.json to include a section similar to the following:
{
// ... skipping unrelated option settings ...
"paths": {
"angular-web-bluetooth": [
"dist/manekinekko/angular-web-bluetooth/manekinekko-angular-web-bluetooth",
"dist/manekinekko/angular-web-bluetooth"
]
}
}
Don't forget it's a JSON file, so no trailing commas, and quotes matter. Also, just to be over-cautious: the '... skipping unrelated options settings ...' is NOT something to put in the file!
With the folder imported to your dist/
and configured in tsconfig.json
, you should be able to import from 'angular-web-bluetooth'
. For example, in src/app/app.module.ts
I have:
import { WebBluetoothModule } from 'angular-web-bluetooth'
Make sure you have @types/web-bluetooth installed via your package manager. Hopefully, I didn't miss anything. Even more hopefully the next version bump of the package will resolve the issue either intentionally or just as a side-effect, and this won't be something anyone needs to rely on.
from angular-web-bluetooth.
Ultimately the issue is with using Ivy in Angular 9. I've found a work around running npm run prebuild
with Ivy off, and then turning it back on for my local project (where I want to use Ivy)...
in tsconfig.json, add:
"angularCompilerOptions": { "enableIvy": false }
See Angular docs for reference
from angular-web-bluetooth.
The issue has been fixed. Please try the new version v9.1.1.
from angular-web-bluetooth.
Thank you @rjstalb
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
- 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
- Cannot upgrade to 11.2.1 "error TS2307: Cannot find module '@manekinekko/angular-web-bluetooth' or its corresponding type declarations." HOT 7
- 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.