jxnblk / mdx-deck

♠️ React MDX-based presentation decks
https://mdx-deck.jxnblk.com
MIT License
11.36k stars 603 forks source link

"Getting Started" steps do not work #818

Open callumlocke opened 2 years ago

callumlocke commented 2 years ago

First time user. MDX Deck looks great... But I just followed the Getting Started steps precisely (in a new, blank project, nothing weird going on), and npm start just errors out after a few seconds.

My setup:


❯ npm start
TERMINAL OUTPUT ``` > start > mdx-deck deck.mdx info Deleting .cache, public, /Users/callum/code/decks/my-first-deck/node_modules/mdx-deck/node_modules/.cache/babel-loader, /Users/callum/code/decks/my-first-deck/node_modules/mdx-deck/node_modules/.cache/terser-webpack-plugin info Successfully deleted directories /Users/callum/code/decks/my-first-deck/node_modules/gatsby-recipes/dist/graphql-server/server.js:52 var remarkMdx = require('remark-mdx'); ^ Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/callum/code/decks/my-first-deck/node_modules/gatsby-recipes/node_modules/remark-mdx/index.js from /Users/callum/code/decks/my-first-deck/node_modules/gatsby-recipes/dist/graphql-server/server.js not supported. Instead change the require of index.js in /Users/callum/code/decks/my-first-deck/node_modules/gatsby-recipes/dist/graphql-server/server.js to a dynamic import() which is available in all CommonJS modules. at Object. (/Users/callum/code/decks/my-first-deck/node_modules/gatsby-recipes/dist/graphql-server/server.js:52:17) { code: 'ERR_REQUIRE_ESM' } Node.js v17.8.0 success open and validate gatsby-configs - 0.028s success load plugins - 0.129s success onPreInit - 0.013s success initialize cache - 0.004s success copy gatsby files - 0.056s success onPreBootstrap - 0.008s success createSchemaCustomization - 0.004s success Checking for changed pages - 0.001s success source and transform nodes - 0.031s success building schema - 0.099s info Total nodes: 35, SitePage nodes: 2 (use --verbose for breakdown) success createPages - 0.010s success Checking for changed pages - 0.000s success createPagesStatefully - 0.017s success update schema - 0.007s success write out redirect data - 0.001s success onPostBootstrap - 0.001s info bootstrap finished - 1.691s success onPreExtractQueries - 0.000s success extract queries from components - 0.054s info added file at /Users/callum/code/decks/my-first-deck/node_modules/mdx-deck/.cache/dev-404-page.js info added file at /Users/callum/code/decks/my-first-deck/node_modules/mdx-deck/.cache/redirects.json info added directory at /Users/callum/code/decks/my-first-deck/node_modules/mdx-deck/.cache/caches/prod-404 info added directory at /Users/callum/code/decks/my-first-deck/node_modules/mdx-deck/.cache/caches/dev-404-page success write out requires - 0.002s success run page queries - 0.010s - 2/2 198.68/s info added file at /Users/callum/code/decks/my-first-deck/node_modules/mdx-deck/.cache/async-requires.js info added file at /Users/callum/code/decks/my-first-deck/node_modules/mdx-deck/.cache/match-paths.json info added file at /Users/callum/code/decks/my-first-deck/node_modules/mdx-deck/.cache/json/_dev-404-page_.json info added file at /Users/callum/code/decks/my-first-deck/node_modules/mdx-deck/.cache/json/_.json info added file at /Users/callum/code/decks/my-first-deck/node_modules/mdx-deck/.cache/sync-requires.js success building schema - 0.053s info Total nodes: 44, SitePage nodes: 2 (use --verbose for breakdown) success createPages - 0.001s success Checking for changed pages - 0.000s success update schema - 0.006s success onPreExtractQueries - 0.000s success extract queries from components - 0.008s success write out requires - 0.001s info added directory at /Users/callum/code/decks/my-first-deck/node_modules/mdx-deck/.cache/caches/webpack-theme-component-shadowing info added directory at /Users/callum/code/decks/my-first-deck/node_modules/mdx-deck/.cache/caches/gatsby-plugin-compile-es6-packages info added directory at /Users/callum/code/decks/my-first-deck/node_modules/mdx-deck/.cache/webpack info added directory at /Users/callum/code/decks/my-first-deck/node_modules/mdx-deck/.cache/webpack/babel info added file at /Users/callum/code/decks/my-first-deck/node_modules/mdx-deck/.cache/webpack/babel/a3eed5463e0710b1 3a3288bce4a99fb6.json.gz ERROR error:0308010C:digital envelope routines::unsupported Error: error:0308010C:digital envelope routines::unsupported - hash:67 new Hash node:internal/crypto/hash:67:19 - node:crypto:135 Object.createHash node:crypto:135:10 - createHash.js:135 module.exports [my-first-deck]/[webpack]/lib/util/createHash.js:135:53 - NormalModule.js:417 NormalModule._initBuildHash [my-first-deck]/[webpack]/lib/NormalModule.js:417:16 - NormalModule.js:471 handleParseError [my-first-deck]/[webpack]/lib/NormalModule.js:471:10 - NormalModule.js:503 [my-first-deck]/[webpack]/lib/NormalModule.js:503:5 - NormalModule.js:358 [my-first-deck]/[webpack]/lib/NormalModule.js:358:12 - LoaderRunner.js:373 [my-first-deck]/[loader-runner]/lib/LoaderRunner.js:373:3 - LoaderRunner.js:214 iterateNormalLoaders [my-first-deck]/[loader-runner]/lib/LoaderRunner.js:214:10 - LoaderRunner.js:221 iterateNormalLoaders [my-first-deck]/[loader-runner]/lib/LoaderRunner.js:221:10 - LoaderRunner.js:236 [my-first-deck]/[loader-runner]/lib/LoaderRunner.js:236:3 - LoaderRunner.js:111 context.callback [my-first-deck]/[loader-runner]/lib/LoaderRunner.js:111:13 - index.js:59 [my-first-deck]/[babel-loader]/lib/index.js:59:71 not finished Building development bundle - 0.528s Error: Command failed with exit code 1: gatsby develop --host localhost --port 8000 --open at makeError (/Users/callum/code/decks/my-first-deck/node_modules/execa/lib/error.js:59:11) at handlePromise (/Users/callum/code/decks/my-first-deck/node_modules/execa/index.js:114:26) at processTicksAndRejections (node:internal/process/task_queues:96:5) ```
c0h1b4 commented 2 years ago

This is a defunct project. It is no use banging in the wall to make it work with updated technology like new versions of gatsby or nodejs. If you want to use it, you have to stick to old versions of node and gatsby.

Jossdz commented 2 years ago

@c0h1b4 which version do you recommend?

chrislacey89 commented 2 years ago

@Jossdz take a look at this example: https://codesandbox.io/s/github/jxnblk/mdx-deck/tree/master/examples/syntax-highlighting?file=/deck.mdx. I was able to get this working with theme imports using node v16.14.2

FlorianCassayre commented 2 years ago

I was able to make it work using an existing package-lock.json, namely this one.