Code Monkey home page Code Monkey logo

Comments (15)

stephenmichaelf avatar stephenmichaelf commented on May 16, 2024

Could you try downgrading Node to 9.x.x? We had seen bugs last week with Node 10.0.0 that they were investigating.

from typed-rest-client.

cryo75 avatar cryo75 commented on May 16, 2024

I've tried 9.11.1 and 8.11.1 (the receommended version). I still get the same build errors. Are there any other librariies that I need to install locally?

from typed-rest-client.

stephenmichaelf avatar stephenmichaelf commented on May 16, 2024

It should be fully self contained, I assume you ran npm install? Is the code accessible in a repo somewhere? I can take a look.

from typed-rest-client.

cryo75 avatar cryo75 commented on May 16, 2024

Here's the link to the source:
https://1drv.ms/u/s!AhG37UfEsI26hMsS8wy6NmYx2DsVQQ

from typed-rest-client.

stephenmichaelf avatar stephenmichaelf commented on May 16, 2024

I pulled the code and ran:

npm install
npm run build

And it seems to have worked fine.

What steps are you following? Perhaps try to delete the package-lock.json and build again?

from typed-rest-client.

cryo75 avatar cryo75 commented on May 16, 2024

Umm I commented out the code that was giving the errors. Place this code in login.service.ts:

`
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';

import * as hm from 'typed-rest-client/Handlers';
import * as httpm from 'typed-rest-client/HttpClient';

@Injectable()
export class LoginService {
constructor(private http: HttpClient) {}

async test() {
    var username = "";
    var password = "";
    var workstation = "";
    var domain = "";
    var url = "";
    
    const ntlmHandler: hm.NtlmCredentialHandler = new hm.NtlmCredentialHandler(username, password, workstation, domain);

    const httpClient: httpm.HttpClient = new httpm.HttpClient('vsts-node-api', [ntlmHandler]);
    const response: httpm.HttpClientResponse = await httpClient.get(url);
    console.log("response code: " + response.message.statusCode);
}

}
`

from typed-rest-client.

stephenmichaelf avatar stephenmichaelf commented on May 16, 2024

I think this is related to WebPack, see here. Will keep digging.

from typed-rest-client.

cryo75 avatar cryo75 commented on May 16, 2024

Any ETA on how to get this to work?

from typed-rest-client.

stephenmichaelf avatar stephenmichaelf commented on May 16, 2024

Will take another look today.

from typed-rest-client.

stephenmichaelf avatar stephenmichaelf commented on May 16, 2024

It looks like issues with Angular 6, see here for more context. I don't think this is an issue with the library but a dependency issue with Angular that you are seeing manifested in a reference to this lib. Perhaps follow the directions from that thread or try a different version of Angular.

from typed-rest-client.

cryo75 avatar cryo75 commented on May 16, 2024

This is the answer I got from the Angular dev team:
https://github.com/angular/angular-cli/issues/10844#event-1624981900

Can something be done that this library works in the browser?

from typed-rest-client.

stephenmichaelf avatar stephenmichaelf commented on May 16, 2024

Let me investigate this, I think we would like the library to be usable in the browser as long as it's not too cumbersome to do so.

Adding @bryanmacfarlane for visibility.

Will look into this today.

from typed-rest-client.

mitchcapper avatar mitchcapper commented on May 16, 2024

Like the library but certainly would like it to be more browser/client friendly:)

from typed-rest-client.

damccorm avatar damccorm commented on May 16, 2024

I think Browserify might be the solution here - you could try:

  1. Create a nodejs file that you want to run in the browser
  2. Include whatever modules you need with 'require(typed-rest-client/abcModule)'
  3. Run browserify on that file
  4. Include the resulting bundle as a script in your html file.

from typed-rest-client.

stephenmichaelf avatar stephenmichaelf commented on May 16, 2024

Closing this due to inactivity, please reopen if it's still an issue.

from typed-rest-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.