Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing validation: createModuleRunner #59

Open
dario-piotrowicz opened this issue Nov 12, 2024 · 0 comments
Open

Missing validation: createModuleRunner #59

dario-piotrowicz opened this issue Nov 12, 2024 · 0 comments

Comments

@dario-piotrowicz
Copy link
Contributor

During the module runner initialization we call createModuleRunner:

In this function we the module runner is created by instantiating a new ModuleRunner instance.

The classes constructor is pretty unlikely to throw, but I don't think that that's not impossible (especially when developing our plugin) and if that happens no error is presented anywhere and we simply end up with a non instantiated module runner (which might be quite surprising during debugging).

I think it would be much nicer to have some proper error handling here and on the dev server side of things even kill the whole process in case some error was actually thrown (since if a module runner is not present the whole environment is not actually usable).


Additionally we have this code to make sure that we don't create multiple module runners per environment:

if (moduleRunner) {
throw new Error('Runner already initialized');
}

But again this error is practically suppressed, I'd imagine that we'd also want to kill the whole process in case this happens?
(or maybe in this case it would be ok to simply show a warning in the terminal?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant