-
Notifications
You must be signed in to change notification settings - Fork 694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CodePane not working properly when using create-react-app #456
Comments
That is a conscious limitation of
Furthermore it doesn't come with the support for any kind of raw-loader out of the box. There's an ongoing issue on how to improve this situation: facebook/create-react-app#3722 Meanwhile you have three other options luckily:
I don't think there's a lot about it actually. One option would for us to add a raw-loader to spectacle-scripts, which we can discuss, but that'd mean that spectacle-scripts would further diverge from the regular react-scripts. cc @kenwheeler |
I'd be fine with adding |
Alright I love the heck out of spectacle and can't stand that this is still a thing 😂 I will very happily do whatever work is required here. What's the move? Add raw-loader to spectacle scripts? |
Pretty much, yeah. |
It looks like this landed in Can someone verify / try things off of github master and report back here? Thanks! |
I am stuck on this issue too. I have been trying to use
|
I had the same issue so the easiest way for me to resolve this was to:
"scripts": {
- "start": "react-scripts start",
- "build": "react-scripts build",
},
"scripts": {
+ "start": "react-app-rewired start",
+ "build": "react-app-rewired build",
},
|
Apparently it's enough to turn off the eslint check by adding this comment line:
|
All those workarounds are clever, but what's the problem we want to solve here? All we really want is to load plain text files, right? So you can get around this problem just by suffixing your examples with <CodePane lang="elixir" source={require("./assets/digger_step1.example.txt")} />
<CodePane lang="elixir" source={require("./assets/digger_step2.txt")} /> You could use |
@jmagrippis Using Fortunately the raw-loader approach just works in the latest create-react-app version of spectacle: In the end this seems to be more an issue with create-react-app than with spectacle, imo. Possibly spectacle-scripts could offer some customisation over the cra defaults but then this creates another maintainability problem. |
Just checking in on this, loving this project so far, but def got tripped up trying to use CodePane and ComponentPlayground. Is there a punch list of work that has been identified to address this issue. +1 for pulling in raw loader as that is the goal of the project - to present code, etc. |
@mfellner, Thanks a lot. putting '!' in the beginning resolved my issue. |
We've updated our CodePane component to use the latest and greatest in react-live, and I believe this issue is no longer relevant |
Hi,
I followed
create-react-app my-presentation --scripts-version spectacle-scripts
to create a simple presentation.I have a CodePane like:
<CodePane lang="elixir" source={require("raw-loader!./assets/digger_step1.example")} />
I get the following error:
Failed to Compile displays in the browser along with a message
Line 63: Unexpected '!' in 'raw-loader!./assets/demo.example'. Do not use import syntax to configure webpack loaders import/no-webpack-loader-syntax
I added
"raw-loader": "^0.5.1"
in the package.json and didnpm install
but that hasn't resolved the issue.The text was updated successfully, but these errors were encountered: