Skip to content
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

Custom app _app getInitialProps not running #1116

Closed
danielpid opened this issue Jul 20, 2023 · 6 comments
Closed

Custom app _app getInitialProps not running #1116

danielpid opened this issue Jul 20, 2023 · 6 comments

Comments

@danielpid
Copy link

danielpid commented Jul 20, 2023

What version of this package are you using?
2.5.0

What operating system, Node.js, and npm version?
macOS Monterrey, node v16.15.1, npm 8.11.0

What happened?
I'm using Nextjs and next-translate in an nx monorepo. I have a custom app on _app with a getInitialProps that I use for initializing different tools. With Nextjs 12.3.1 and next-translate 1.6.0, everything was working fine.

I upgraded Nextjs from 12.3.1 -> 13.4.10. At this point, I got an error because the i18n config file couldn't be found despite having the NEXT_TRANSLATE_PATH env var defined. There was a thread suggestion to change that env var value to '../../' for dev and './' for production. This worked after I upgraded next-translate to 2.5.0.

The problem I have at the moment is that the function getInitialProps in _app doesn't run.

What did you expect to happen?
I want the MyApp.getInitialProps to run.

Are you willing to submit a pull request to fix this bug?
Yes

@danielpid
Copy link
Author

After checking the code I realized this problem comes from next-translate-plugin and there's already an issue created there aralroca/next-translate-plugin#8. I'll follow up there.
Thanks!

@aralroca
Copy link
Owner

I guess is related that we replaced all regex to the typescript parser to detect the loaders.

@aralroca
Copy link
Owner

@all-contributors please add @danielpid for code

@allcontributors
Copy link
Contributor

@aralroca

I've put up a pull request to add @danielpid! 🎉

@aralroca
Copy link
Owner

Fixing also pageExtensions like _app.pages.js in aralroca/next-translate-plugin#35. @all-contributors please add @TheMatrixan for code

@allcontributors
Copy link
Contributor

@aralroca

I've put up a pull request to add @TheMatrixan! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants