Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
silesky opened this issue Jul 13, 2021 · 0 comments
Open

Comments

@silesky
Copy link

silesky commented Jul 13, 2021

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);
@silesky silesky changed the title Doesn't _seem_ to be a drop-in replacement Breaks when pages are in .tsx Jul 13, 2021
@silesky silesky changed the title Breaks when pages are in .tsx Unexpected behavior when pages are in .tsx (no front-matter / layouts declared) Jul 13, 2021
@silesky silesky changed the title Unexpected behavior when pages are in .tsx (no front-matter / layouts declared) Odd behavior when page is in .tsx (no front-matter / layouts declared) Jul 13, 2021
@silesky silesky changed the title Odd behavior when page is in .tsx (no front-matter / layouts declared) Parse issue when page is in .tsx (no front-matter / layouts declared) Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant