-
Notifications
You must be signed in to change notification settings - Fork 134
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
Facing issue with fortawesome integration with babel-plugin-macros. #196
Comments
You're running the code that hasn't had the macro compiled. Look, you're seeing the app code call into the macro implementation, which should never happen:
Since you mention |
No Conrad, it's babel.json. json only
…On Fri, 3 Nov 2023, 18:46 Conrad Buck, ***@***.***> wrote:
You're running the code that hasn't had the macro compiled. Look, you're
seeing the app code call into the macro implementation, which should never
happen:
@ .***@***.***/fontawesome-svg-core/import.macro.js
@ ./js/components/Page.react.tsx
Since you mention babel.json I'm going to assume that that is the
problem. I think you mean babelrc.json? If indeed you made that typo it
would explain everything.
—
Reply to this email directly, view it on GitHub
<#196 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKAYU2P2UW6ROBIBLI36P6TYCTVC7AVCNFSM6AAAAAA635OF6KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJSGQZDANJSGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Here is what the docs say about valid config file names. Notice that |
@conartist6 Apologies for the typo in my previous comment. The file name in my project is babel.config.json. I have updated my original post as well. What do you mean by app code calling the macro implementation directly? Please see how I am importing the Fontawesome and macro in my original post. |
I'm just reading the stack trace you shared. It shows While a macro import looks like a normal import, the imported file isn't runnable code! |
@conartist6 thanks for taking time to reply. Could you please point me to some potential places to look for. |
Without knowing anything about your environment, I can tell you very little. |
Are you running babel on the CLI? ...or through it's API? Through something like create-react-app? A node module loader? What I'm asking is how do you expect the code you're running to be transformed by babel? Can you verify that other babel plugins are being run? |
@conartist6 create-react-app is not used. We have a custom webpack configuration doing the bundling. babel-loader is configured in it. Please see below snippet from webpack.config.js
Below is how my babel.config.json looks like -
Regarding your point that these plugins are working or not, I am right now assuming that these should be working, but I can verify. I will see how to make sure that the plugins are working. I will update you. Besides that if there is anything else I can provide to you please do let me know. |
|
You can and probably should use |
@conartist6 I just started to work on this area of the project so I don't know much about it. So, as of now it seems like that my babel.config.json isn't read by babel-loader and |
It would hardly be the strangest thing I've seen, or even the strangest thing I've done myself and left for someone else to find... |
Is your issue resolved? Can we close this issue? Are there any specific follow-on issues we should create? |
@conartist6 apologies for replying late, I was not able to resolve the issue so what I did for now is do individual import of fortawesome icons in components as mentioned in their doc. https://fontawesome.com/docs/web/use-with/react/add-icons. This method doesn't require the need for the macro at the cost of some extra code that needs to be written while importing the icons in a component. Thank you for your support, really appreciate it. |
Sounds like a smart choice to keep yourself making progress for now. |
I have raised the bug in fortawesome repo.
FortAwesome/react-fontawesome#554
Please help me fix these warnings as it's not allowing me to compile my code.
The text was updated successfully, but these errors were encountered: