dart_custom_lint icon indicating copy to clipboard operation
dart_custom_lint copied to clipboard

[Documentation] Failed to start plugin error when "custom_lint.dart" file doesn't exist

Open pattobrien opened this issue 2 years ago • 2 comments

Error is received in the pubspec.yaml file (of the application depending on a custom lint) when setting up first lint:

Failed to start plugin dart(custom_lint_plugin_error)

Steps to Reproduce:

  1. Create a new dart package, e.g. dart create my_lints.
  2. Create a custom lint and place it in bin/my_lints.dart (where file name = anything besides 'custom_lint.dart')
  3. Create a test dart application my_example_app and depend on custom_lint and my_lints
  4. "Failed to start plugin" error appears in my_example_app pubspec.yaml file

I'm not sure if the invertase team is at the documentation stage of this project yet, but for what its worth I found the setup and development extremely intuitive (especially with the walkthrough video), besides the lack of documentation / emphasis on this one requirement. Since the error received is also so vague, it took a bit of time for me to track down the root cause of the problem. A simple note in the readme may go a long way to help other early-adopters of this package.

Thanks you all for a great package!

pattobrien avatar Jul 12 '22 21:07 pattobrien

Hello!

I'm not exactly sure. What do you find vague here? The documentation tells you to create a file named custom_lint.dart yet you purposefully used a different name. The error also tells you that the file bin/custom_lint.dart is missing (which it is since you used a different name).

So far all of that is expected.

What else would you like to see? :)

rrousselGit avatar Jul 12 '22 21:07 rrousselGit

Of course, in hindsight it seems like an obvious oversight - I'm not disagreeing with you there ;)

AFAIK its not common for dart tools to require an exact file name in order for functionality to work, especially a required file name thats [some_dependency].dart... I think the inability to customize a filename (which dart create generates as my_dart_app.dart) is an easy thing to overlook.

A more descriptive error than "Failed to start plugin" would be helpful I think (have the message point the user to the log file, ask to check the filename/spelling/etc - whatever you think makes sense) or if not possible for whatever reason, simply more strongly emphasizing this point in the readme would probably help at least somewhat with learning pains.

pattobrien avatar Jul 12 '22 22:07 pattobrien

Closing in favour of https://github.com/invertase/dart_custom_lint/issues/2

rrousselGit avatar Jan 17 '23 21:01 rrousselGit