SDK Assistance (Angular 9)
See original GitHub issueConfirm by changing [ ] to [x] below:
- I’ve searched for previous similar issues and didn’t find any solution
Known Issue
- I’m using ATS data type endpoint: the endpoint should look like
<prefix>-ats.iot.<region>.amazonaws.com
Platform/OS/Hardware/Device What are you running the sdk on? Ionic 5 (Angular 9), aws-iot-device-sdk-v2, MacOS Catalina
Node: 12.16.2 NPM: 6.14.7
Describe the question Hi,
I have read the basic PubSub docs & Examples here (multiple times), and been trying to understand the basic flow of it. Would you mind showing me the way towards how to properly establish the connection to AWS IoT via MQTT, and one example of Sub?
Here’s what I have, and stuck in confusion.
import { Injectable } from '@angular/core';
import { iot } from 'aws-iot-device-sdk-v2';
@Injectable({
providedIn: 'root'
})
export class AWSIoTService {
constructor() { }
async connect() {
let config = null;
config = iot.AwsIotMqttConnectionConfigBuilder.new_mtls_builder_from_path('file.private.key', 'file.cert.pem')
.with_certificate_authority_from_path('root-CA.crt')
.with_port(8863)
.with_endpoint('xxxx-ats.iot.ap-southeast-1.amazonaws.com')
.build();
console.log('Main');
}
}
ERROR in node_modules/aws-crt/dist/native/auth.d.ts:5:8 - error TS1192: Module '"/Users/raeveen/Documents/client/node_modules/aws-crt/dist/native/binding"' has no default export.
5 import crt_native from './binding';
~~~~~~~~~~
node_modules/aws-crt/dist/native/http.d.ts:5:8 - error TS1192: Module '"/Users/raeveen/Documents/client/node_modules/aws-crt/dist/native/binding"' has no default export.
5 import crt_native from './binding';
ERROR in ./node_modules/aws-crt/dist.browser/browser/http.js
Module not found: Error: Can't resolve '@awscrt/io' in '/Users/raeveen/Documents/Ionic Development/quix/quix-admin-dashboard/node_modules/aws-crt/dist.browser/browser'
Appreciate your time and assistance for a small kick start.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Angular versioning and releases
Minor releases are fully backward-compatible; no developer assistance is expected during update, but you can optionally modify your applications and ...
Read more >API List - Angular
Angular is a platform for building mobile and desktop web applications. Join the community of millions of developers who build compelling user interfaces ......
Read more >Angular
Angular is a platform for building mobile and desktop web applications. Join the community of millions of developers who build compelling user interfaces ......
Read more >angular/service-worker
Implements a service worker for Angular apps. Adding a service worker to an Angular app is one of the steps for turning it...
Read more >CLI Overview and Command Reference - Angular
Online help is available on the command line. Enter the following to list commands or options for a given command (such as generate)...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hi @KaibaLopez,
I can now confirm that this issue is now resolved.
The latest release in aws-crt did the trick.
Thank you for your assistance.
Ok, new update. I’ve managed to get it to work there is a few things that I had to change besides the ones I mentioned on the comment above.
So, the issue is that some methods and classes are just not browser compatible, like ‘new_mtls_builder_from_path’ for example, the only way I found to establish a connection is through new_with_websockets, so that would change the code a bit:
This way i got a connection established using the sample you provided, I know it is not yet a pub_sub yet but I hope it helps you get there and let me know if you need some other help with that. Also, I never encountered the error from the original post, was that also happening on your the sample code you provided? Does it keep happening after the changes I suggested?