Skip to content

gatsby-theme-i18n is incompatible with the new gatsby-plugin-mdx v4 #172

Description

@EricCote

The new gatsby-plugin-mdx v4 has a lot of internal changes and new features.

Because of these internal changes, gatsby-theme-i18n fails to add the locale for .mdx files. Luckily, the fix is easy.

The error is in the gatsby-node.js file, on line 126.

Old Line:

  const name = path.basename(node.fileAbsolutePath, `.mdx`)

New Line:

// v3: fileAbsolutePath,  v4: contentFilePath
  const name = path.basename(node.fileAbsolutePath ?? node.contentFilePath, `.mdx`)

I'll do a pull request

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions