mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
93.63k stars 32.22k forks source link

[docs-infra] Unable to download codesandbox #38860

Closed Janpot closed 1 year ago

Janpot commented 1 year ago

Duplicates

Latest version

Steps to reproduce 🕹

Link to live example:

Steps:

  1. Go to an example
  2. Follow codesandbox button
  3. In Files, click "export to ZIP"

    Screenshot 2023-09-07 at 15 45 17

  4. Unpack the archive
  5. navigate to the folder and run yarn && yarn start

Current behavior 😯

Screenshot 2023-09-07 at 15 47 19

Failed to compile.

Module not found: Error: Can't resolve './Demo' in '/Users/janpotoms/Desktop/k5gwnp/src'
ERROR in ./src/index.tsx 7:0-26
Module not found: Error: Can't resolve './Demo' in '/Users/janpotoms/Desktop/k5gwnp/src'

webpack compiled with 1 error

Expected behavior 🤔

  1. Run mv src/tsconfig.json tsconfig.json
  2. Run again yarn start

Now it works

Context 🔦

Your environment 🌎

npx @mui/envinfo ``` Don't forget to mention which browser you used. Output from `npx @mui/envinfo` goes here. ```
Janpot commented 1 year ago

I noticed the default create-react-app template that ours is based on uses a src folder to contain the application. I suspect that it could start working if we change https://github.com/mui/material-ui/blob/7f81475ea148a416ec8fab252120ce6567c62897/docs/src/modules/sandbox/CodeSandbox.ts#L44-L49

to

    [`src/index.${ext}`]: {
      content: CRA.getRootIndex(demoData),
    },
    [`src/Demo.${ext}`]: {
      content: demoData.raw,
    },
Karthikeya-Meesala commented 1 year ago

Hey @siriwatknp,

I'm interested in working on this issue. Could you please assign it to me? I'd appreciate some guidance on how to get started and the best approach to tackle this.

Thanks!

siriwatknp commented 1 year ago

Hey @siriwatknp,

I'm interested in working on this issue. Could you please assign it to me? I'd appreciate some guidance on how to get started and the best approach to tackle this.

Thanks!

Assigned, thanks for asking!

Karthikeya-Meesala commented 1 year ago

Hi @siriwatknp, Thank you for assigning the issue to me. I've taken a closer look at the problem and the suggestions provided by Janpot. I'm considering starting with the file structure adjustment as proposed. Before I proceed, I'd appreciate any insights or suggestions you might have on this approach or if there are other considerations I should be aware of.

Aditya-Sakpal commented 1 year ago

Is this issue open ? Should I start working on it??

siriwatknp commented 1 year ago

Hi @siriwatknp, Thank you for assigning the issue to me. I've taken a closer look at the problem and the suggestions provided by Janpot. I'm considering starting with the file structure adjustment as proposed. Before I proceed, I'd appreciate any insights or suggestions you might have on this approach or if there are other considerations I should be aware of.

I think you can try the suggestion from @Janpot and see if it solve the problem.

ARJ2160 commented 1 year ago

Hi, I have just started contributing to open source. If there are any changes you'd like to make to the PR please free to! PS - Thank you @Janpot, the suggestion was tremendously helpful!