udacity / reactnd-contacts-complete

Code-along project for the Contacts app
https://www.udacity.com/course/react-nanodegree--nd019
170 stars 579 forks source link

Failed to compile: `./src/index.js` [Solved] #12

Closed batwell31 closed 6 years ago

batwell31 commented 6 years ago

8:36-39 "export 'default' (imported as 'App') was not found in './App'

Anyone experience this issue? I'm trying to do the files manually as they are being shown in the commits, but when I run the server i'm getting this error! Please help!

this is my app.js file:

import React, { Component } from 'react';

class App extends Component {
  render() {
    return (
      <div>
        Hello World
      </div>
    )
  }
}

This is my index.js file:

import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';

ReactDOM.render(<App />, document.getElementById('root'));
registerServiceWorker();
batwell31 commented 6 years ago

Wow I feel stupid, after reading the message again I figured it out. I needed to add export default App; to my app.js file! Simple enough.

ajkr22 commented 2 years ago

Solved @batwell31 Thanks