-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Cannot compile after update #982
Comments
Why and how are you transpiling? |
Did you clone the repo? npm i? npm run build? |
No. I run command npm update. |
Failed to compile. ./node_modules/react-i18next/src/withTranslation.js <---- that is the source files your app should use the compiled files do you import like: |
https://github.com/i18next/react-i18next/tree/master/example/react is an example...with |
Can I use new version, if my project not used babel? |
I would say yes - when you know what you're doing...there are builds for commonjs, esm, umd in build folder |
We have a create-react-app project which uses Typescript, created 10 months ago, and yarn upgraded to the latest nmp packages. (Do not know if Typescript is relevant here.) The problem is that our app tries to compile withTranslation.js as a Javascript but since the above mentioned commit it contains some JSX language constrcuctions. So our build system (which is create-react-app based, not we configured) can not compile it. Since this is the only .js file with JSX in our whole node_modules directory (which enumerates more than 50 thousand files) I kindly ask if it is possible to go back to plain Javascript in this only one withTranslation.js file? Only one programmable JSX instantiation is needed here... Thanks in advance. |
I've got here because of the same issue, and in my case the problem was in VSCode automatic import. The translation hook was imported by VSC like so:
Changing the line above to |
@koverg70 PR welcome |
as discussed in i18next#982
If you like this module don’t forget to star this repo. Make a tweet, share the word or have a look at our https://locize.com to support the devs of this project. If you liked my support / work - I would enjoy a coffee sponsored using the “:purple_heart:Sponsor Button”. There are many ways to help this project 🙏 |
Failed to compile.
./node_modules/react-i18next/src/withTranslation.js
SyntaxError: ./node_modules/react-i18next/src/withTranslation.js: Unexpected token (28:39)
26 | I18nextWithTranslation.WrappedComponent = WrappedComponent;
27 |
The text was updated successfully, but these errors were encountered: