-
When building a custom sf plugin, sometimes the plugin fails to even compile - eg. Running: Gives:
This is normally down to things like wonky imports after a refactor - but I'm always at a loss at how to debug. Eslint is generally reporting everything is fine, and without being able to even run the plugin, I can't use the normal debugging options. Possibly a stupid question (I'm fairly new to JS/TS) - but whats the right thing to do when this happens, other than spending a long time trying random things until I've worked out whats wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hey @tomcarman - Are you running |
Beta Was this translation helpful? Give feedback.
-
Hi @WillieRuemmele, thanks for the reply. I tried deleting the For additional context, its a plugin generated with the This works great most of the time, but occasionally I manage to introduce an issue when developing thats not picked up by eslint, and causes the command to fail to properly compile, giving the error in the initial post. I've had this a few times now, and normally just have to end up reverting changes one-by-one until I can work out where its falling over. But it would great if I could get some better debug information to make this easier. Any other ideas? Edit I've actually just tried something that I think is pointing me in the right direction, I just tried executing the command .js file directly eg:
...and I can now see the error causing the issue - I introduced some circular dependencies when refactoring. |
Beta Was this translation helpful? Give feedback.
-
Looks like you figured this out, but I've found that sometimes a |
Beta Was this translation helpful? Give feedback.
Hi @WillieRuemmele, thanks for the reply.
I tried deleting the
lib
directory and recompiling withyarn build
. It builds with no warnings / errors, but still get the same error when trying to run a command.For additional context, its a plugin generated with the
sf dev
plugin. And I am trying to execute my command locally using the providedbin/dev.js
eg. this https://github.com/salesforcecli/plugin-template-sf-external/blob/main/bin/dev.jsThis works great most of the time, but occasionally I manage to introduce an issue when developing thats not picked up by eslint, and causes the command to fail to properly compile, giving the error in the initial post.
I've had this a few times now, an…