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

Error message for missing features #684

Closed
Dreamsorcerer opened this issue Apr 6, 2022 · 8 comments
Closed

Error message for missing features #684

Dreamsorcerer opened this issue Apr 6, 2022 · 8 comments

Comments

@Dreamsorcerer
Copy link

From: PSPDFKit-labs/browserslist.dev#39
They think something should be fixed here.

If the 'supports' feature fails to recognise a name, there is no useful error message to explain what failed.

For example, I wanted to search for this intersection of features:
supports custom-elementsv1 and supports es6-module-dynamic-import and supports es6-class and supports replace-all and supports shadowdomv1

It seems that one of the values is not recognised, but it's rather difficult to figure out which one.

@ai
Copy link
Member

ai commented Apr 6, 2022

Wendy error do el hace right now?

@Dreamsorcerer
Copy link
Author

I think a cat just walked on your keyboard. :P

But, if you look at the linked issue, the developer says "right now browserslist isn't throwing a stable error for missing features."

My problem is that browserslist.dev just doesn't update anything if there is a missing feature, so I can't even tell there's an error at all.

@ai
Copy link
Member

ai commented Apr 6, 2022

Can you help me: run Browserslist with broken query and copy the error?

@Dreamsorcerer
Copy link
Author

I'm afraid I don't even have npm installed.

@ai
Copy link
Member

ai commented Apr 7, 2022

You can try any online IDE.

It is not cool to demand something from open-source maintainer who is working for free and avoid giving any help.

@Dreamsorcerer
Copy link
Author

Didn't know online npm IDEs even existed. But, I just tried at npm.runkit.com/npm with:

require('browserslist')()
browserslist.coverage(browserslist('supports custom-elementsv1 and supports es6-module-dynamic-import and supports es6-class and supports replace-all and supports shadowdomv1', { stats }), stats)

And just get a reference error, I've no idea how to actually import it.

I'm just relaying the information from the other issue, as that author seems to think it's a problem here, but has neglected to open an issue. I maintain plenty of projects myself, so don't have the time to figure out how to run this. If it was one of my projects, I'd have no problem running 1 command from my own project, or looking directly at the source code for the errors being returned (and adding documentation for those errors).

@ai
Copy link
Member

ai commented Apr 10, 2022

Here is what error I have in CLI:

$ npx browserslist 'supports custom-elementsv1 and supports es6-module-dynamic-import and supports es6-class and supports replace-all and supports shadowdomv1'
/home/ai/Dev/browserslist/cli.js:97
      throw e
      ^

Error: Cannot find module 'caniuse-lite/data/features/replace-all.js'

The error message is not very cryptic for my taste.

Do we really need to improve it?

Looks like the cryptic message was from browserslist.dev way to build JS bundle.

@ai
Copy link
Member

ai commented Jul 27, 2022

Fixed by #714

@ai ai closed this as completed Jul 27, 2022
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

2 participants