Closed iva2k closed 4 years ago
I narrowed down the issue to change in node_modules/@types/express-serve-static-core/index.d.ts@4.16.6, this code is removed compared to 4.16.0:
export interface Application extends EventEmitter, IRouter, Express.Application {
...
/**
* Configure callback for zero or more envs,
* when no `env` is specified that callback will
* be invoked for all environments. Any combination
* can be used multiple times, in any order desired.
*
* Examples:
*
* app.configure(function(){
* // executed for all envs
* });
*
* app.configure('stage', function(){
* // executed staging env
* });
*
* app.configure('stage', 'production', function(){
* // executed for stage and production
* });
*
* Note:
*
* These callbacks are invoked immediately, and
* are effectively sugar for the following:
*
* var env = process.env.NODE_ENV || 'development';
*
* switch (env) {
* case 'development':
* ...
* break;
* case 'stage':
* ...
* break;
* case 'production':
* ...
* break;
* }
*/
configure(fn: Function): Application;
configure(env0: string, fn: Function): Application;
configure(env0: string, env1: string, fn: Function): Application;
configure(env0: string, env1: string, env2: string, fn: Function): Application;
configure(env0: string, env1: string, env2: string, env3: string, fn: Function): Application;
configure(env0: string, env1: string, env2: string, env3: string, env4: string, fn: Function): Application;
To see the effect, add older version of the package:
npm i -D @types/express-serve-static-core@4.16.0
It makes the error go away, log.start:
> feathers-app@0.0.0 start C:\dev\feathers-app
> ts-node --files src/
info: Feathers application started on http://localhost:3030
+1 on this. I'm also having trouble when trying to add authentication. It seems like even with the above fix I still run into issues:
feathers-plus generate options
# select all the defaults, except select typescript
feathers-plus generate app
# select all defaults
feathers-plus generate authentication
# select all defaults
npm i -D @types/express-serve-static-core@4.16.0
npm start
The above will fail
+1 same here! Any notice of this?
Yes - im blocked also by this.
Any ideas what to downgrade?
@eddyystop
Any updates on this? Long time Feathers developer, would love to get started with Typescript. This one is preventing that. Cheers :)
@Ziao I'm not sure whether this is "the" fix, but looking around it looks like this could fix it:
// in ./src/app.interface.ts, end of the file
export type App = Application<{
'accounts': Account,
'users': User,
'authentication': any, // THIS
// !code: moduleExports // !end
}>;
I'm very very new to Feathers though
It also could need Authentication as any in Application in certain cases. We fixed this in our own feathers-plus implementation along with other TS features like Enums. Will open a PR soon. Or maybe wait for v4.
Steps to reproduce
Using Windows7, node v8.11.2, Performed the following steps from https://generator.feathers-plus.com/get-started/
Expected behavior
Server should start
Actual behavior
TypeScript compilation fails, log.start:
System configuration
Tell us about the applicable parts of your setup.
Module versions (especially the part that's not working): @feathers-plus/cli@0.8.10
NodeJS version: v8.11.2 v11.4.0 (also tried with, using nvm)
Operating System: Windows 7
Module Loader: npm 6.9.0