Closed michael-lloyd-morris closed 1 year ago
I did not know that it's valid to import a common JS module. That does explain why the error messages are so different. Of the two native nodejs errors that one is the more easy to understand, so I'll remove the catch on the importer for now to satisfy this requirement along with the scenario testing for that code change. Shall I keep the remaining feature alone in it's own file or move it into the esm.feature file? (on second thought, just going ahead and doing that as it makes the most sense, but I can undo it).
Requested Changes applied.
Is there something else I need to do or where the changes I did insufficient?
Just a couple of things to address but this is looking like a good change. Also see a conflict on the changelog file.
I'll get to these items in the morning and will try to be done by end of day, though I've got to take a chunk of the day to take my Dad to the hospital.
(Until I have a job, volunteer work here is my job - if only to keep my skills sharp and my sanity intact - so I'm treating it as such).
Ok, all requested changes applied, though see the note about Typescript and using the cause option on Error throws.
🤔 What's changed?
The error message viewed when importing a CommonJS module or requiring an ES module is now customized.
⚡️ What's your motivation?
Making life easier when simple mistakes are made. The error message Node gives when you try to import steps using CommonJS format or require an ES module are a bit cryptic. The new error message tells the user they are using the wrong directive and to either change the file's format or use the other directive to include the file.
🏷️ What kind of change is this?
📋 Checklist: