-
-
Notifications
You must be signed in to change notification settings - Fork 31
Description
Describe the bug
In the development setup (i.e. using VOLUMES_PLUGINS=./.local/plugins) having no plugins, i.e. nothing the TS-Compiler copies over to dist, results in an error log during server start.
To Reproduce
Steps to reproduce the behavior:
- Clone this repository.
- Copy the
.dev.envto.env. - Run the server using
pnpm start. - Observe the
error: ┏ Error loading plugins. +7ms
error: ┃ [ 1] [[
error: ┃ [ 2] undefined
error: ┃ [ 3] ]]
error: ┃ [ 4] {
error: ┃ [ 5] context: undefined,
error: ┃ [ 6] error: [Error: ENOENT: no such file or directory, scandir '[...]/dist/.local/plugins'] {
error: ┃ [ 7] code: 'ENOENT',
error: ┃ [ 8] errno: -2,
error: ┃ [ 9] path: '[...]/dist/.local/plugins',
error: ┃ [10] syscall: 'scandir'
error: ┃ [11] },
error: ┃ [12] timestamp: '...'
error: ┗ [13] }Expected behavior
The server should start up with Found 0 plugins to load. and Loaded 0 plugins.
Additional context
If no .ts file exists anywhere in ./.local/plugins then the TS-Compiler will not create a dist/.local/plugins directory, thus the readdir(...) Operation will try to access injectDir=[...]/dist/.local/plugins and throw an Error, which leads to the fallback log.
Possible Fix
Add await mkdir(injectDir, { recursive: true }) (importing mkdir from fs-extra) after this line.
Code Understanding
Lastly while reading through the code, I was unsure whether it is intended to show injectDir as /tmp in the initial log. Is this just a placeholder?
Metadata
Metadata
Assignees
Labels
Type
Projects
Status