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

Autoloader eats errors #12

Closed
woahdae opened this issue Dec 28, 2020 · 3 comments
Closed

Autoloader eats errors #12

woahdae opened this issue Dec 28, 2020 · 3 comments

Comments

@woahdae
Copy link

woahdae commented Dec 28, 2020

Since work is currently being done on the autoloader (#3, #11) I thought I'd ask - any interest in letting autoloader errors just happen?

The autoloader transforms import errors into a "Failed to autoload controller: ..." message. While writing a stimulus controller, I made a SyntaxError by importing a wrong module name, and had to stick a debugger into the catch statement to dig it out.

IMHO if something fails to load, swallowing the error a) confuses development, and b) will almost certainly break something downstream anyways unless your controller was entirely cruft.

At the minimum, it should console.log the error, no?

@mgodwin
Copy link

mgodwin commented Dec 28, 2020

I was bitten by this as well - I think a fix could be as easy as
console.log(`Failed to autoload controller: ${controllerName}`, error)

@dhh
Copy link
Member

dhh commented Dec 30, 2020

Agree we should add a console log error.

@dhh
Copy link
Member

dhh commented Jan 19, 2021

Fixed in f551af0

@dhh dhh closed this as completed Jan 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants