question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pageExtensions error on initial try

See original GitHub issue

Hello 👋🏾

First off, thank you for creating this package as it’s currently exactly what we’re looking for in the application our company is working on.

I’m not sure if this is the correct place for this type of question but I couldn’t find any related Slack channel so I’ll leave this here until told otherwise.

My issue

I’m having a really hard time configuring the next-multilingual package. I have now tried both configurations (simple & advanced). I’ve followed through the whole configuration flow as shown on the README file.

In both cases, the result is as shown in the screenshot below 👇🏾

Screenshot 2021-09-21 at 12 14 54


My understanding is that the pageExtensions parameter in the configurations takes into account the file extensions used by the pages in our application. At the moment, all pages in our app have a .jsx extension… which shouldn’t really cause the condition to set off this error.

I may be overlooking or underthinking something here, any insight would be really helpful. Thanks 😊

Below I’m attaching how our next.config.js file looks like

const { MulConfig } = require("next-multilingual/config");

const mulConfig = new MulConfig("testerApp", [
  "nl-NL",
  "en-NL",
  "nl-BE",
  "en-BE",
  "en-GB",
]);

/*const STUDIO_REWRITE = {
  source: "/studio/:path*",
  destination:
    process.env.NODE_ENV === "development"
      ? "http://localhost:3333/studio/:path*"
      : "/studio/index.html",
};*/

module.exports = {
  /* rewrites: () => [STUDIO_REWRITE], */
  trailingSlash: true,
  images: {
    domains: ["ibb.co"],
  },
  i18n: {
    locales: mulConfig.getUrlLocalePrefixes(),
    defaultLocale: mulConfig.getDefaultUrlLocalePrefix(),
  },
  poweredByHeader: false,
  webpack(config, { isServer }) {
    if (isServer) {
      config.resolve.alias["next-multilingual/link$"] = require.resolve(
        "next-multilingual/link/ssr"
      );
    }
    return config;
  },
  async rewrites() {
    return mulConfig.getRewrites();
  },
  async redirects() {
    return mulConfig.getRedirects();
  },
};

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
reMRKableDevcommented, Sep 23, 2021

@nbouvrette Using npm, version 7.12.1.
Macbook --> Mac Big Sur version 11.5.2

0reactions
nbouvrettecommented, Sep 29, 2021

Awesome, keep us posted - our goal is to make this one of the best i18n packages around 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

pageExtensions not respecting file extension · Issue #6878
Describe the bug. If I provide next.config.js a pageExtensions value of pageExtensions: ['tsx'] I am having pages created for non-tsx ...
Read more >
Can't build React/Next project - found page without a ...
When a file is added to the pages directory it's automatically available as a route. By default, Next.js assumes anything under the pages...
Read more >
Front Page-Get server error when I attempt to publish. Host ...
Front page extensions are installed. The server is in service. Front page has published to this site many hundreds of times. I have...
Read more >
Custom Page Extensions - next.config.js
Extend the default page extensions used by Next.js when resolving pages in the pages directory. ... Inside next.config.js , add the pageExtensions config:...
Read more >
Development-only pages in Next.js
To get around this, the code above tries the .dev.[js|jsx] first, then falls back to .[js|jsx] . This code will allow you to ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found