Cannot destructure property `metatype` of 'undefined' or 'null' on related modules
See original GitHub issueI’m submitting a…
[ ] Regression
[√] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
in my project https://github.com/notadd/next, i define a test module like:
import { Module } from "@nestjs/common";
@Module({
})
export class TestModule {
}
thrown a exception:
TypeError: Cannot destructure property `metatype` of 'undefined' or 'null'.
at flatMap.filter.related (/home/code/next/node_modules/@nestjs/core/injector/injector.js:226:38)
at Array.filter (<anonymous>)
at modules.concat.apply.modules.map (/home/code/next/node_modules/@nestjs/core/injector/injector.js:225:62)
at Array.map (<anonymous>)
at Injector.flatMap (/home/code/next/node_modules/@nestjs/core/injector/injector.js:223:54)
at Injector.<anonymous> (/home/code/next/node_modules/@nestjs/core/injector/injector.js:197:46)
at Generator.next (<anonymous>)
at /home/code/next/node_modules/@nestjs/core/injector/injector.js:7:71
at new Promise (<anonymous>)
at __awaiter (/home/code/next/node_modules/@nestjs/core/injector/injector.js:3:12)
1: node::Abort() [/usr/bin/node]
2: 0x11ef459 [/usr/bin/node]
3: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) [/usr/bin/node]
4: 0xb7c08c [/usr/bin/node]
5: v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/bin/node]
6: 0x3e8d43f042fd
Expected behavior
Minimal reproduction of the problem with instructions
https://github.com/notadd/next
What is the motivation / use case for changing the behavior?
Environment
Nest version: 4.6.5
For Tooling issues:
- Node version: 9.3
- Platform: Linux
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:14 (3 by maintainers)
Top Results From Across the Web
Cannot destructure property `metatype` of 'undefined' or 'null' on ...
Cannot destructure property `metatype` of 'undefined' or 'null' on related modules.
Read more >Cannot destructure property `variableName` of 'undefined' or ...
The original error say's: Cannot destructure property 'firstime' of 'undefined' or 'null' . I am developing web-base desktop application for ...
Read more >TypeError: Cannot destructure property 'interface' of 'require ...
TypeError : Cannot destructure property 'interface' of 'require(. ... _compile (node:internal/modules/cjs/loader:1101:14) at Object.Module.
Read more >cannot read properties of undefined (reading 'type') nestjs
When I try to load related products of a category I get error. I have a business product category entity as below: import...
Read more >import.meta - JavaScript - MDN Web Docs
The import.meta meta-property exposes context-specific metadata to a JavaScript module. It contains information about the module, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
这个版本有点低啊,我看网上都是让升级到4+以上的版本,但是现在我也没管他,只要不进行升级就能跑起来,因为只是用来学习的,也没有深究过,非常感谢告诉解决办法
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.