Skip to content
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

Quokka with create-react-app #343

Closed
danielv6987 opened this issue Mar 17, 2019 · 2 comments
Closed

Quokka with create-react-app #343

danielv6987 opened this issue Mar 17, 2019 · 2 comments
Labels

Comments

@danielv6987
Copy link

Issue description or question

Getting an error when starting Quokka on an existing React file. Its actually the boilerplate file created by create-react-app (App.js). Getting a different error when using Quokka.js New Javascript File, but I will create a new issue for that error.

create-react-app -V 2.1.5
package-json

Thank you

Sample code

import React, { Component } from "react";
import logo from "./logo.svg";
import "./App.css";

class App extends Component {
    render() {
        return (
            <div className="App">
                <header className="App-header">
                    <img src={logo} className="App-logo" alt="logo" />
                    <p>
                        Edit <code>src/App.js</code> and save to reload.
                    </p>
                    <a
                        className="App-link"
                        href="https://reactjs.org"
                        target="_blank"
                        rel="noopener noreferrer"
                    >
                        Learn React
                    </a>
                </header>
            </div>
        );
    }
}

export default App;

Sample repository link

If the issue can not be reproduced just using the quokka file above
(for example because it requires/imports some files from your project),
please create a small repository where the issue can be reproduced.

Quokka.js Console Output

​​​​Quokka 'App.js' (node: v10.13.0, babel: v7.2.2, plugins: jsdom-quokka-plugin)​​​​
 
Unexpected identifier 
  at ​​​new Script​​​ ​vm.js:79​
  at ​​​createScript​​​ ​vm.js:251​
  at ​​​Object.runInThisContext​​​ ​vm.js:303​
  at ​​​Module._compile​​​ ​internal/modules/cjs/loader.js:656​

Code editor version

Visual Studio Code v1.? 1.32.3
Webstorm v?
Atom v1.?

OS name and version

Windows 10
OSX
Linux

@ArtemGovorov
Copy link
Member

Thanks for the report. The issue was caused by the very recently introduced change. The issue is now fixed and the fix is published in the latest Quokka version 1.0.196.

@danielv6987
Copy link
Author

@ArtemGovorov it's now working. I was able to resolve my other issue by adding @babel/preset-react. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants