GithubHelp home page GithubHelp logo

Comments (6)

vadistic avatar vadistic commented on April 25, 2024

Yeah, it's not there.


$ tree /home/vadistic/dev/rewarp/node_modules/@nestjs/azure-func-http/dist
/home/vadistic/dev/rewarp/node_modules/@nestjs/azure-func-http/dist
├── azure-http.adapter.d.ts
├── azure-http.adapter.js
├── index.d.ts
└── index.js

from azure-func-http.

travis-r6s avatar travis-r6s commented on April 25, 2024

I found I could build this locally. When I do, it creates a subfolder router inside dist, but it appears this is not uploaded to npm.
image

However, after linking this package to a project, and import via import { AzureHttpRouter } from '@nestjs/azure-func-http/dist/router' I get an error thrown:

No overload matches this call.
  Overload 1 of 2, '(module: any, options?: NestApplicationOptions): Promise<INestApplication>', gave the following error.
    Type 'AzureHttpRouter' has no properties in common with type 'NestApplicationOptions'.
  Overload 2 of 2, '(module: any, httpAdapter: AbstractHttpAdapter<any, any, any>, options?: NestApplicationOptions): Promise<INestApplication>', gave the following error.
    Argument of type 'AzureHttpRouter' is not assignable to parameter of type 'AbstractHttpAdapter<any, any, any>'.
      Property 'instance' is protected but type 'AbstractHttpAdapter<TServer, TRequest, TResponse>' is not a class derived from 'AbstractHttpAdapter<TServer, TRequest, TResponse>'.ts(2769)

from azure-func-http.

kamilmysliwiec avatar kamilmysliwiec commented on April 25, 2024

Fixed in 0.3.1

from azure-func-http.

jparneodo avatar jparneodo commented on April 25, 2024

With 0.3.1 :
Using const app = await NestFactory.create(AppModule, new AzureHttpRouter());

Log:

[25/11/2019 00:41:30] [Nest] 36920   - 2019-11-25 1:41:30 AM   [NestFactory] Starting Nest application...                                                           
[25/11/2019 00:41:30] [Nest] 36920   - 2019-11-25 1:41:30 AM   [InstanceLoader] AppModule dependencies initialized +34ms                                            
[25/11/2019 00:41:30] [Nest] 36920   - 2019-11-25 1:41:30 AM   [InstanceLoader] UsersModule dependencies initialized +2ms                                           
[25/11/2019 00:41:30] [Nest] 36920   - 2019-11-25 1:41:30 AM   [InstanceLoader] GraphQLModule dependencies initialized +3ms                                         
[25/11/2019 00:41:30] (node:36920) UnhandledPromiseRejectionWarning: Error: No support for current HttpAdapter: AzureHttpRouter                                     
[25/11/2019 00:41:30]     at GraphQLModule.registerGqlServer (c:\DEV\node_modules\@nestjs\graphql\dist\graphql.module.js:132:19)    
[25/11/2019 00:41:30]     at GraphQLModule. (c:\DEV\node_modules\@nestjs\graphql\dist\graphql.module.js:116:18)          
[25/11/2019 00:41:30]     at Generator.next ()                                                                                                           
[25/11/2019 00:41:30]     at fulfilled (c:\DEV\node_modules\@nestjs\graphql\dist\graphql.module.js:17:58)  

Something wrong here or with graphql configuration?

from azure-func-http.

Yhozen avatar Yhozen commented on April 25, 2024

the graphql module only supports express and fastify as seen here

/* GraphQLModule.registerGqlServer */
 if (platformName === 'express') {
      this.registerExpress(apolloOptions);
    } else if (platformName === 'fastify') {
      this.registerFastify(apolloOptions);
    } else {
      throw new Error(`No support for current HttpAdapter: ${platformName}`);
    }
  }

I think the only solution is to use express instead of AzureHttpRouter

from azure-func-http.

skapoor8 avatar skapoor8 commented on April 25, 2024

Experiencing the same issue. func host start does not seem to work while using AzureHttpRouter :/ Every route request fails with an unhandled exception because new AzureHttpRouter() throws an exception:

UnhandledPromiseRejectionWarning: TypeError: trouter_1.default is not a constructor

from azure-func-http.

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.