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.
mootari
December 23, 2022, 11:53am
2
Have a look at the module require debugger:
Loading modules is tricky! Because modules are tricky. Let's try to make them a little easier. Enter a module into the moduleName field below, click Go, and see which module-loading strategies will work. Analysis Okay, what kind of entry points do we...
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.
Cobus
December 24, 2022, 5:55am
5
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:
opened 09:21PM - 18 Mar 22 UTC
Feature Request
Notebook
**Is your feature request related to a problem? Please describe.**
It is usua… lly possible to add third party libraries to observable but the default method proposed in snippets often fails.
![image](https://user-images.githubusercontent.com/34020210/159084173-1e13865f-74c7-4742-9717-1778f49af6ab.png)
**Describe the solution you'd like**
You already have a [solution](https://observablehq.com/@observablehq/module-require-debugger) on observable but I can't imagine it would be easy to find for new users.
**Describe alternatives you've considered**
If I were a new user to observable and tried installing a third party library and it didn't work I might just give up.
As an example I tried installing `@gaearon/lag-radar` but accidentally typed `require(lag-radar)`. While the module-require-debugger I linked above says *this package is not published on npm* the default require just fails with a cryptic error message.
When I tried `require(@gaeron/lag-radar)` I got another error message. At that point I would probably give up but it turns out you can require `@gaeron/lag-radar` using skypack. `import('https://cdn.skypack.dev/@gaearon/lag-radar@0.1.0?min')`.
Would be amazing if some of this could be simplified for users since JS developers rely heavily on third party libs for almost everything.
opened 08:47PM - 11 Aug 21 UTC
Feature Request
Notebook
**Is your feature request related to a problem? Please describe.**
You try to r… equire some snippet or code and it's not a module or something. You just get an error message, but no "help". If I did not know about the "module require debugger" I would be lost. Please add a link to this debugger when the UI detects that the user is trying and failing to include some code.
- or -
Somehow embed this debugging capability into the response like " could not require blah, try using this: 'bundle.run blah blah"
**Describe the solution you'd like**
When the user hits a "require error" of some kind - add something like "for help with requiring other code see https://observablehq.com/@observablehq/module-require-debugger"
**Describe alternatives you've considered**
I just have it bookmarked and use it every day.
**Additional context**
New users will not have any idea how to get something to work on their own, and might leave in frustration. Offering up some contextual help for a very common issue would help newbies learn to use Observable.
1 Like
It appears I already upvoted the first issue in August 2021.
1 Like