Question: TypeScript Configuration / getOwnMetadata() returns undefined
See original GitHub issueHello,
I try to use this project for my next js-server application. I tried many things to got this to working but for whatever reason the metadata could not be readen.
As far as I understand the problem for me are the getRouter() implementation in the main Server.js file. Line 65 always returns undefined:
var classMetadata = Reflect.getOwnMetadata(types_1.classMetadataKey, prototype);
Maybe I messed up with the tsconfig. These are my current settings:
{
"compilerOptions": {
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
"declaration": true, /* Generates corresponding '.d.ts' file. */
"outDir": "./dist", /* Redirect output structure to the directory. */
"baseUrl": "./",
"importHelpers": true, /* Import emit helpers from 'tslib'. */
"strict": true, /* Enable all strict type-checking options. */
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
"emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
"skipLibCheck": true, /* Skip type checking of declaration files. */
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
}
}
For the demo purpose I used the example UserController.ts provided by the example application.
TypeScript: 3.9.2 Node: v14.1.0 npm: 6.14.4 @overnightjs/core 1.7.0
The readme says something about the lib
property but no more information are given there -_- Many thanks for your support in advance.
Dennis
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Please upgrade to 1.7.3 to make this problem go away
I downgraded to 1.6.2 and it solved it. 1.7.2 fixes it too.