You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{Container}from'~/components/ui/container.tsx'import{json}from'@remix-run/node'/* import { useLoaderData } from '@remix-run/react'import { useMemo } from 'react' */import{bundleMDX}from'mdx-bundler'/* import { getMDXComponent } from 'mdx-bundler/client' */exportconstloader=async()=>{constsource=`---title: Example Postpublished: 2021-02-13description: This is some description---# WahooHere's a **neat** demo.`.trim()const{ code, frontmatter }=awaitbundleMDX({ source })returnjson({})}constTestingMDX=()=>{//const { code, frontmatter } = useLoaderData<typeof loader>()// it's generally a good idea to memoize this function call to// avoid re-creating the component every render.//const Component = useMemo(() => getMDXComponent(code), [code])return(<Container><p>Hello world!</p><header>{/* <h1>{frontmatter.title}</h1> <p>{frontmatter.description}</p> */}</header><main>{/* <Component /> */}</main></Container>)}exportdefaultTestingMDX
What I did:
Followed instructions to install mdx-bundler and esbuild
Added server deps: serverDependenciesToBundle: ['mdx-bundler', 'mdx-bundler/client'],
What happened:
bundleMDX() errors with:
Things I've tried:
Tried adding esbuild to server deps but it doesn't seem related to that.
The text was updated successfully, but these errors were encountered:
mdx-bundler
version: 9.2.1node
version: 18.2.0npm
version: 9.7.2Relevant code or config
What I did:
serverDependenciesToBundle: ['mdx-bundler', 'mdx-bundler/client'],
What happened:
Things I've tried:
esbuild
to server deps but it doesn't seem related to that.The text was updated successfully, but these errors were encountered: