babel-plugin-macros version: ^3.0.1
node version: v12.16.3
npm version: 6.14.4
Relevant code or config
function macroHandler({ references, state, babel }: MacroParams) {
const { types: t } = babel;
const { Hello = []} = references;
Hello.forEach((refPath) => {
throw new MacroError("Not Working");
});
}
What you did:
I tried this macro on another create-react-app.
What happened:
This macro error was only available when app was started or build.
// this is not the exact code. I used my Macro in App render function.
import {Hello} from 'my-macro/lib/hello-macro.macro';
Hello("World")
Problem description:
Error was not shown on vscode. The macro I am building is a little bit complex so I am asserting errors at the early stages.
- Is there any way to show the error with line-numbers or columns in vscode or other IDEs?
- What is the use of
MacroError? Can this be used in to do that?
- I tried
buildCodeFrameError which gave some context where error is happening. Not in the IDE, but at time of compilation. So which one should be used?
Suggested solution:
None