Closed aureliopita-au closed 1 year ago
👍 I just encountered the same issue. I originally thought I implemented getInitialProps
incorrectly, but it turns out it was not called at all. After some debugging, I noticed that config.skipInitialProps
is internally set to "true" (incorrectly, probably because of this plugin). 🤔
I have encountered the same issue in our nextjs setup.
Did you guys find a solution to this? @aralroca any ideas?
I think the error is related in this line of code:
We replaced all regex by the TypeScript parser, but it probably has using a bad way to detect the getInitialProps
. Feel free to PR to fix this.
Hi @aralroca, I implemented a fix for this, could you add me as a collaborator so I can open a PR and continue the discussion there? Thanks!
Thanks so much @danielpid !!
@danielpid is already available in 2.5.3-canary.1, please confirm that is working fine in your projects before close this issue! Thanks
@aralroca I confirm it works on my projects. Thanks!
Cool!!!
What version of this package are you using? "next": "^13.2.3", "next-translate": "^2.0.2", "next-translate-plugin": "^2.0.2", "react": "^18.2.0", "react-dom": "^18.2.0"
What operating system, Node.js, and npm version? MacOS, Node v16.18.0, npm 8.19.2.
What happened? When using
nextTranslate()
insidenext.config.js
,getInitialProps
from_app
stops working.What did you expect to happen?
getInitialProps
from_app
keeps working.Are you willing to submit a pull request to fix this bug? Not at the moment.
Reproducible repo Based on the
basic
example from your repo. Just added agetInitialProps
to_app
. https://github.com/aureliopita-au/next-translate-getInitialProps-bug