Skip to content

evaling code breaks if code contains import statements with sources that should be resolved by the bundler #66

@icco

Description

@icco

There seems to be an issue with how contentlayer2 uses React which triggers a bug in versions of nextjs

Some documentation on their issues:

The exact change mentioned is in vercel/next.js#76395 (comment) which implies this package needs to change how it imports React.

My typescript & React knowledge is pretty limited so I don't entirely understand what change needs to be made, but this prevents next dev from serving MDX content from contentlayer.

As a user you will see an error like

 ✓ Compiled /post/[slug] in 646ms (1674 modules)
 ⨯ TypeError: Cannot read properties of undefined (reading 'stack')
    at stringify (<anonymous>) {
  digest: '986669656'
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions