Anybody here who had been successful in using the stellar-sdk in angular without any error? I am getting - cannot read property crc16xmodem error - anybody encountered this before?

  • 1
    Thanks for your question. If you don't get a good response, consider updating your question with an MCVE. stackoverflow.com/help/mcve
    – Synesso
    Commented Jul 22, 2018 at 8:42
  • Which version of Angular? I'm using it on projects running 4, 5, and 6. Let me know and I'll answer with the correct configuration steps (it's different on each...). Commented Jul 22, 2018 at 15:50

2 Answers 2


As others have mentioned, it sounds like a conflict rather than an import issue. That said, I'm fairly certain I've seen that error before, a long time ago, and I have not used node-crc.

For Angular 6, I use the following configuration:

After installing, you need to add it to angular.json under:

  "architect": {
    "build": {
        "scripts": [

In my StellarService class, I import using:

import * as StellarSdk from 'stellar-sdk/dist/stellar-sdk.min.js';

declare const StellarSdk: any;

export class StellarService {

    private server: any;

    constructor() {
        this.server = new StellarSdk.Server('https://horizon.stellar.org');

For Angular 5, in your .angular-cli.json:

  "apps": [
      "scripts": [

Class import is the same as Angular 6.

For Angular 4:

Same as 5, except I'm fairly certain I had to add a typings.d.ts file under /src and in it I had to declare:

declare var StellarSdk: any;

This sounds like a dependency conflict.

There is another project that had this (or a similar) problem. They solved it by removing their dependency on node-crc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.