hozana / next-translate-routes

Flexible and translated routes for Next.js without custom server
MIT License
115 stars 31 forks source link

I'm using next@11.1.2 with pages router, but still getting the "does not support `/app` directory yet." error #93

Open pakyardim opened 5 months ago

pakyardim commented 5 months ago

I've just installed the next-translated-routes@1.10.2 package and I have been trying to use it. However, I cannot start the application after wrapping the next.config.js with withTranslateRoutes as shown in the documentation:

const withTranslateRoutes = require('next-translate-routes/plugin')

module.exports = withTranslateRoutes({
  i18n: {
    locales: ['en', 'fr', 'es', 'pl'],
    defaultLocale: 'pl',
  },
})

and I'm getting the error next-translate-routes does not support /app directory yet.

But the problem is I don't have an app directory. So I checked the function that causes the error:

image

From what I understand, this code var pagesDirs = (0, find_pages_dir_1.findPagesDir)(process.cwd(), false); here is supposed to return an object. But it returns a string instead, therefore var pagesDir = pagesDirs.pages becomes undefined and causes the error.

What can I do to fix it?

pakyardim commented 5 months ago

I suppose you have fixed it but haven't released it yet