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

Error: Cannot read properties of undefined (reading '_context') #1019

Closed
benjick opened this issue Apr 1, 2023 · 2 comments
Closed

Error: Cannot read properties of undefined (reading '_context') #1019

benjick opened this issue Apr 1, 2023 · 2 comments

Comments

@benjick
Copy link

benjick commented Apr 1, 2023

What version of this package are you using?
2.0.4

What operating system, Node.js, and npm version?
I'm running OSX

node -v
v18.7.0
npm -v
8.15.0

What happened?
I'm trying to migrate to use the app-directory. I've created this minimal page to try it out:

import { CarDatabase } from "src/CarDatabase";
import useTranslation from "next-translate/useTranslation";

async function getCars() {
  const cars = await CarDatabase.findAllCars(12);
  return cars;
}

export default async function Page() {
  const cars = await getCars();
  const { t, lang } = useTranslation("common");
  return <p>Foo bar</p>;
}

But I'm getting the following error:

Error: Cannot read properties of undefined (reading '_context')

What did you expect to happen?

I expected it to not throw

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

I'm not sure what the error is

@aralroca
Copy link
Owner

aralroca commented Apr 1, 2023

Try next-translate-plugin 2.0.5-canary.1

@benjick
Copy link
Author

benjick commented Apr 1, 2023

Hey! Thank you, I tried 2.0.5-canary.1 and it worked fine!

@benjick benjick closed this as completed Apr 1, 2023
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