Closed benwis closed 3 years ago
I'm sorry, but this doesn't give us enough information to be able to help much 😬
A reproduction would be good.
I know, I'm trying to dig into it now. bundleMDX() just returns undefined , the remix console just says there was an error running the loader, and the console output in the browser shows this
GET http://127.0.0.1:3000/blog/compile-mdx-on-remix 500 (Internal Server Error)
compile-mdx-on-remix:6 GET http://127.0.0.1:3000/build/path net::ERR_ABORTED 404 (Not Found)
compile-mdx-on-remix:6 GET http://127.0.0.1:3000/build/fs net::ERR_ABORTED 404 (Not Found)
compile-mdx-on-remix:6 GET http://127.0.0.1:3000/build/worker_threads net::ERR_ABORTED 404 (Not Found)
compile-mdx-on-remix:6 GET http://127.0.0.1:3000/build/child_process net::ERR_ABORTED 404 (Not Found)
compile-mdx-on-remix:6 GET http://127.0.0.1:3000/build/crypto net::ERR_ABORTED 404 (Not Found)
compile-mdx-on-remix:6 GET http://127.0.0.1:3000/build/tty net::ERR_ABORTED 404 (Not Found)
compile-mdx-on-remix:6 GET http://127.0.0.1:3000/build/os net::ERR_ABORTED 404 (Not Found)
compile-mdx-on-remix:6 GET http://127.0.0.1:3000/build/module net::ERR_ABORTED 404 (Not Found)
compile-mdx-on-remix:6 GET http://127.0.0.1:3000/build/util net::ERR_ABORTED 404 (Not Found)
compile-mdx-on-remix:1 Uncaught TypeError: Failed to resolve module specifier "path". Relative references must start with either "/", "./", or "../".
react-dom-af783853.js:9 TypeError: Cannot read property 'root' of undefined
at react-57beb414.js:1
at Array.map (<anonymous>)
at b (react-57beb414.js:1)
at react-57beb414.js:1
at Object.useMemo (react-dom-af783853.js:9)
at Object.t.useMemo (react-f725fe97.js:9)
at M (react-57beb414.js:1)
at no (react-dom-af783853.js:9)
at Qu (react-dom-af783853.js:9)
at Ci (react-dom-af783853.js:9)
au @ react-dom-af783853.js:9
t.callback @ react-dom-af783853.js:9
sa @ react-dom-af783853.js:9
du @ react-dom-af783853.js:9
Pi @ react-dom-af783853.js:9
e.unstable_runWithPriority @ scheduler-a04990bf.js:9
Bl @ react-dom-af783853.js:9
Ni @ react-dom-af783853.js:9
hi @ react-dom-af783853.js:9
si @ react-dom-af783853.js:9
Yi @ react-dom-af783853.js:9
(anonymous) @ react-dom-af783853.js:9
gi @ react-dom-af783853.js:9
ns @ react-dom-af783853.js:9
hydrate @ react-dom-af783853.js:9
(anonymous) @ entry.client-3c5e76b8.js:1
react-57beb414.js:1 Uncaught TypeError: Cannot read property 'root' of undefined
at react-57beb414.js:1
at Array.map (<anonymous>)
at b (react-57beb414.js:1)
at react-57beb414.js:1
at Object.useMemo (react-dom-af783853.js:9)
at Object.t.useMemo (react-f725fe97.js:9)
at M (react-57beb414.js:1)
at no (react-dom-af783853.js:9)
at Qu (react-dom-af783853.js:9)
at Ci (react-dom-af783853.js:9)
(anonymous) @ react-57beb414.js:1
b @ react-57beb414.js:1
(anonymous) @ react-57beb414.js:1
useMemo @ react-dom-af783853.js:9
t.useMemo @ react-f725fe97.js:9
M @ react-57beb414.js:1
no @ react-dom-af783853.js:9
Qu @ react-dom-af783853.js:9
Ci @ react-dom-af783853.js:9
Ei @ react-dom-af783853.js:9
Si @ react-dom-af783853.js:9
hi @ react-dom-af783853.js:9
si @ react-dom-af783853.js:9
Yi @ react-dom-af783853.js:9
(anonymous) @ react-dom-af783853.js:9
gi @ react-dom-af783853.js:9
ns @ react-dom-af783853.js:9
hydrate @ react-dom-af783853.js:9
(anonymous) @ entry.client-3c5e76b8.js:1
contentscript.js:390 Uncaught TypeError: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type 'Node'.
at startMutationObserver (contentscript.js:390)
at Object.start (contentscript.js:450)
Let me try to stand up a repo, I shjould be able to do that in 20 minutes or so.
Reproducing Repo. Doing the exact same thing as my main site! https://github.com/benwis/kent-remix-mdx_bundler-broken
Looks like with either the new compiler(and the errorneous imports removed) or the old compiler, the error now boils down to this:
App Error
Named export 'generate' not found. The requested module 'astring' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'astring';
const {baseGenerator, generate} = pkg;
Replace this UI with what you want users to see when your app throws uncaught errors. The file is at app/App.tsx.
All this work, and it turns out the only thing wrong is that mdx-bundler has some old deps. If you run yarn upgrade or your equivalent to update the package.jsons, you're all good. Thanks for maintaining this!
I've updated to the latest everything in #26 so this can be closed when that gets merged.
index.tsx:1295 Uncaught TypeError: Cannot read properties of undefined (reading 'pathname')
at resolveTo (index.tsx:1295:39)
at index.tsx:620:11
at mountMemo (react-dom.development.js:15846:19)
at Object.useMemo (react-dom.development.js:16219:16)
at useMemo (react.development.js:1532:21)
at useResolvedPath (index.tsx:619:10)
at useHref (index.tsx:361:36)
at components.js:343:14
at renderWithHooks (react-dom.development.js:14985:18)
at updateForwardRef (react-dom.development.js:17044:20)
resolveTo @ index.tsx:1295
(匿名) @ index.tsx:620
mountMemo @ react-dom.development.js:15846
useMemo @ react-dom.development.js:16219
useMemo @ react.development.js:1532
useResolvedPath @ index.tsx:619
useHref @ index.tsx:361
(匿名) @ components.js:343
renderWithHooks @ react-dom.development.js:14985
updateForwardRef @ react-dom.development.js:17044
beginWork @ react-dom.development.js:19098
callCallback2 @ react-dom.development.js:3945
invokeGuardedCallbackDev @ react-dom.development.js:3994
invokeGuardedCallback @ react-dom.development.js:4056
beginWork$1 @ react-dom.development.js:23964
performUnitOfWork @ react-dom.development.js:22776
workLoopSync @ react-dom.development.js:22707
renderRootSync @ react-dom.development.js:22670
performSyncWorkOnRoot @ react-dom.development.js:22293
scheduleUpdateOnFiber @ react-dom.development.js:21881
updateContainer @ react-dom.development.js:25482
(匿名) @ react-dom.development.js:26021
unbatchedUpdates @ react-dom.development.js:22431
legacyRenderSubtreeIntoContainer @ react-dom.development.js:26020
hydrate @ react-dom.development.js:26086
(匿名) @ entry.client.tsx:4
mdx with image in
mdx-bundler
version:node
version:npm
version:Relevant code or config
What you did:
What happened:
Reproduction repository:
Problem description: I updated from a pre xdm version of mdx-bundler to the current bundler on Remix v0.15 with the old compiler, and it appears mdx-bundler will not compile any content. I tried substituting my post content with the demo in the readme content was unsuccessful.
This might be the relevant error:
Suggested solution: