[BUG] `mount` is ignored when used in modules
See original GitHub issueInformation
- Version:
>=5.5x
- Packages:
di
I use modules to avoid duplicating common components. It works well when we speak about middleware, filters, and pipes. However, controllers are just ignored. See example below:
@Controller('/')
export class HealthController {
@Get()
@Get('/health')
@Returns(204)
public health(): void {
// noop
}
}
@Module({
mount: {
'/api/v1/': [HealthController]
}
})
export class HealthModule {
// ...
}
@Configuration({
// ...
mount: {
'/api/v1/': [ /* other controllers */ ]
},
imports: [HealthModule]
})
export class Service {
}
I have tried to add controllers on the $beforeInit
hook, it also has no effect.
@Module({
deps: [Configuration]
})
export class HealthModule {
constructor(private readonly configuration: Configuration) {}
public $beforeInit(): void {
const endpoint = '/api/v1/';
this.configuration.mount[endpoint] = (
this.configuration.mount[endpoint] ?? []
).concat(HealthController);
}
}
It seems it somehow connected with importProviders. That method resolves all providers concurrently, while imports
must be initialized before building the module itself according to docs.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
[BUG] `mount` is ignored when used in modules - Tsedio/Tsed
I use modules to avoid duplicating common components. It works well when we speak about middleware, filters, and pipes. However, controllers are just ......
Read more >Mount Fails in Ubuntu 14.04 · Issue #4693 - GitHub
I got the same issue, running the mount on a CentOS machine. Digging trought the module code, I found the issue to be...
Read more >573548 – mount: no option to ignore fstab - Red Hat Bugzilla
Possible solutions: 1) Add a new mount internal option -N (or "-o nofstab") to "Mount without reading in /etc/fstab". This effectively ignores all...
Read more >Bug #1448678 “ntfs3g -s option should be ignored, making autofs ...
I've troubled some with mounting ntfs-3g file systems with autofs. ... options gid=100,dmask=002,fmask=113,utf8,flush,rw,noatime,user using module generic
Read more >Common bugs and issues — Anaconda 38.13 documentation
Anaconda fails with the dasbus.error.DBusError exception. This usually happens when a DBus module raises an unexpected exception. Anaconda shows a traceback ...
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 Free
Top 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
For me it’s works with the latest version (6.x): https://github.com/tsedio/tsed-example-modules
Thanks) Everything works on v6