stackblitz / core

Online IDE powered by Visual Studio Code ⚡️
https://stackblitz.com
MIT License
10.23k stars 888 forks source link

import create-react-app project from Github #314

Closed TheFullResolution closed 6 years ago

TheFullResolution commented 6 years ago

Your docs say you currently support projects using @angular/cli and create-react-app to be imported straight from Github. However, when I use method stackblitz.com/github/{GH_USERNAME}/{REPO_NAME} I got a message "We currently only support projects scaffolded with @angular/cli."

I tried to import a project freshly generated by create-react-app, no changes were included yet.

JochenFromm commented 6 years ago

The problem has been mentioned before in https://github.com/stackblitz/core/issues/302 and I have experienced the same problem too today. You are right, the medium article says: "We currently support creating & exporting Angular apps (based on @angular/cli) and React apps (based on create-react-app)", but currently the system only seems to support Angular apps. 🙁

EricSimons commented 6 years ago

@TheFullResolution @JochenFromm eek, I think this is a bug on our end of things- I'm really sorry about the inconvenience! @apai4 and I are going to get a fix in first thing tmrw morning (+ a couple of other features/fixes we've been working on today :)

Will report back once it's online!

EricSimons commented 6 years ago

Okay, this is now be live on prod! Can y'all test it out on your repos and lmk if you run into any issues?

Seems to be running react-realworld without any issues on my end: https://stackblitz.com/github/gothinkster/react-redux-realworld-example-app

TheFullResolution commented 6 years ago

@EricSimons I tried to run my project: https://stackblitz.com/github/TheFullResolution/dynamic-pure-react-carousel

However, I get the same message. I tried to clear cookies and Firefox and Chrome.

JochenFromm commented 6 years ago

I still get the same message too https://stackblitz.com/github/JochenFromm/block-trends 🙁

EricSimons commented 6 years ago

Forgot to bust the cache of old projects that had failed 😅

@TheFullResolution your project seems to be working! However, in Components/Carousel/CarouselDynamicContainer it looks like you're using a type definition (which only works in .ts files on SB/typescript):

 const slideDivRefs = (el: HTMLDivElement) => {

But if you change it to

 const slideDivRefs = (el) => {

it works perfect :)

@JochenFromm unfortunately your project hit a technical limitation on our end :( Specifically, your project is importing a package called react-flags-select that uses dynamically generated require statements to load in SVG files (ctrl+f for 'svg' in this file to see the offending code). This is a problem because of what makes stackblitz super fast: we only download the files from node_modules that your application actually needs, but dynamic (synchronous) requires breaks this methodology.

We're currently in the middle of a major refactor to our bundler that will solve this problem, but until then I'd recommend using glitch.com's starter project for Create React App as they are actually running node/npm/webpack like normal under the hood.

The new bundler should be out in ~4 weeks or so- will circle back here once it's online :) So sorry about the inconvenience!

TheFullResolution commented 6 years ago

@EricSimons awesome! Yes, I was converting Typescript to JS, I must have missed one bit. The whole project is to help people who are asking questions about pure-react-carousel and give them ready recipes. I think Stackblitz is a perfect tool for it!

Thank you for amazing work!