mdx-js / mdx

Markdown for the component era
https://mdxjs.com
MIT License
17.43k stars 1.14k forks source link

init mdx webpack fails #453

Closed pshrmn closed 5 years ago

pshrmn commented 5 years ago

Subject of the issue

Initializing a Webpack project, as specified on the getting started page of the documentation, fails because there is no examples/webpack directory.

Your environment

Steps to reproduce

npm init mdx webpack
+ tar: mdx-master/examples/webpack: Not found in archive
tar: Exiting with failure status due to previous errors
{ Error: Command failed: curl https://codeload.github.com/mdx-js/mdx/tar.gz/master | tar -xz -C webpack-mdx --strip=3 mdx-master/examples/webpack
    at checkExecSyncError (child_process.js:637:11)
    at execSync (child_process.js:674:13)
    at getTar (/home/paul/.npm/_npx/32285/lib/node_modules/create-mdx/node_modules/initit/index.js:37:3)
    at create (/home/paul/.npm/_npx/32285/lib/node_modules/create-mdx/node_modules/initit/index.js:57:3)
    at Object.<anonymous> (/home/paul/.npm/_npx/32285/lib/node_modules/create-mdx/cli.js:8:1)
    at Module._compile (internal/modules/cjs/loader.js:738:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:749:10)
    at Module.load (internal/modules/cjs/loader.js:630:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:570:12)
    at Function.Module._load (internal/modules/cjs/loader.js:562:3)
  status: 2,
  signal: null,
  output: [ null, null, null ],
  pid: 32326,
  stdout: null,
  stderr: null }

Tell us how to reproduce this issue. Please provide a working and simplified example.

🎉 BONUS POINTS for creating a minimal reproduction and uploading it to GitHub. This will get you the fastest support. 🎉

Expected behaviour

What should happen?

Successful setup

Actual behaviour

What happens instead?

An error is thrown because examples/webpack does not exist.

kjgraham commented 5 years ago

following -- i'm getting the same error

johno commented 5 years ago

Apologies, there isn't a webpack example yet! 😬 In the meantime feel free to try any of the existing directories in the examples directory.

kjgraham commented 5 years ago

thanks @johno! ... i built my react app from scratch (using no starter kit ... just react/webpack/babel/typescript). how would i load in mdx?

johno commented 5 years ago

You can follow along the new v1 docs which are a bit more thorough: https://v1.mdxjs.com/getting-started/webpack

Let me know if you encounter any issues. I'd appreciate any feedback as well.

kjgraham commented 5 years ago

Thanks @johno it worked! Your a life saver!

Here's some feedback on the new docs...

The last sentence in the docs says to run this command

npm install --save-dev @babel/env @babel/react @babel/proposal-object-rest-spread

but some of those packages don't exist.

it worked when i ran this instead...

npm install --save-dev @babel/preset-env @babel/preset-react @babel/plugin-proposal-object-rest-spread

Home that helps!!

johno commented 5 years ago

Thank you for the feedback @kjgraham! I'll amend the docs.