Giter VIP home page Giter VIP logo

Comments (9)

draxx318 avatar draxx318 commented on June 3, 2024 2

It seems like getStaticPaths does not get the translated routes from the _routes.json file.
It looks like it's impossible to combine this library with SSG sadly. I hope this feature will be added soon.

Edit:
I made it work, going to post the solution later.

from next-translate-routes.

ucarno avatar ucarno commented on June 3, 2024

Really need this feature too

from next-translate-routes.

stovein avatar stovein commented on June 3, 2024

Hi, @draxx318 is there any improvements on solution?

from next-translate-routes.

cvolant avatar cvolant commented on June 3, 2024

Sorry, I don't get it, could you explain your issue?
I also have some getStaticPaths and it works well...
You should not have anything to do here: getStaticPaths creates the dynamic file paths, which is then redirected and rewritten using next-translate-routes.

from next-translate-routes.

wangwailok avatar wangwailok commented on June 3, 2024

Sorry, I don't get it, could you explain your issue? I also have some getStaticPaths and it works well... You should not have anything to do here: getStaticPaths creates the dynamic file paths, which is then redirected and rewritten using next-translate-routes.

I am facing the same problem : getStaticProps does not work with translated routes
if you refresh the page, props will pass from getStaticProps to the page.
but if you click the Link from translateRoute, the page wont grab props from getStaticProps

from next-translate-routes.

wangwailok avatar wangwailok commented on June 3, 2024

It seems like getStaticPaths does not get the translated routes from the _routes.json file. It looks like it's impossible to combine this library with SSG sadly. I hope this feature will be added soon.

Edit: I made it work, going to post the solution later.

Can't wait to see your solution!

from next-translate-routes.

cvolant avatar cvolant commented on June 3, 2024

🤔 Strange... I don't have this issue anywhere. Could you provide a minimal reproduction?

from next-translate-routes.

wangwailok avatar wangwailok commented on June 3, 2024

I just found out that if your file contains middleware.ts, getStaticProps will immediately fail.

from next-translate-routes.

cvolant avatar cvolant commented on June 3, 2024

I just found out that if your file contains middleware.ts, getStaticProps will immediately fail.

Yes. See here

So this issue is a duplicate of this one, let's close it.

from next-translate-routes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.