Better messages for import errors

I am trying to use this library.

I assume it is standard ES6 Module, because its README.md doesn’t specify any other specifics.

Is it possible to give an actionable error message in this case?

I understand there are hacks exist to make this module work in Observable, but what I want is to closely follow the library examples without thinking about how to hack them.

import FlameChart from 'flame-chart-js';
const flameChart = new FlameChart({...});

If that could work out of the box, that’d be awesome, but for the time being I’d appreciate if the import error messages guided me through the process.

Have a look at the module require debugger:

As I said, I know that hacks exist. This is a feature request.

Like every few months or so I open Observable to play with some JS module, because I am not a JS guy and have no idea how to run JS locally. And like after 15 minutes of struggling I end up in this Module required debugger, then after 30 minutes more I find my own post TypeError: Convert is not a constructor and at this point I am already too tired to go on.

I do think it would be great to have a better import error message. You may want to upvote these issues in our feedback repo:

1 Like

It appears I already upvoted the first issue in August 2021. :pensive:

1 Like

Thank you