Skip to content

Parse issue when page is in .tsx (no front-matter / layouts declared) #1

Open
@silesky

Description

@silesky

This is something I just ran into, and I thought I would make a report, since this project is meant to be a drop-in replacement for @next/mdx.

When the pages are in .tsx rather than .mdx, (any they import mdx) and do not use the built-in layout behavior, I get the following:

/* pages/index.tsx */

import { Layout } from '../layout';
import Home from '../pages-components/home/home.mdx';
const HomePage = () => {
  return (
    <Layout headDescription="Home" headTitle="Home">
      <Home />
    </Layout>
  );
};

export default HomePage;

image

It also displays the following webpack error:

image

/* next.config.js */
....
const nextConfig = {
  reactStrictMode: true,
  productionBrowserSourceMaps: true,
};

// Enable MDX in Next.js
module.exports = require('@jsdevtools/next-mdx')()(nextConfig);

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