score:141

Accepted answer
import react from 'react'

should be

import react from 'react'

you are trying to import react instead of react. the name of module is case-sensitive, in this case the name is react.

score:-2

including when naming your file, in example you import app but the name on your file is app.js this wont allow the system to find the same name.

score:0

i think you need to install react-router by using this command - npm install react-router-dom

follow this link for further details. (https://reacttraining.com/react-router/web/guides/quick-start)

score:0

i had the same issue. the thing is that the compilation process uses caches to optimize build time. it's a internal thing to "babel loader". to make sure you get a fully refreshed compilation process by webpacker/babel, delete the folder "node_modules/.cache" and run npm start again.

score:1

notification.js

import react from 'react'

const notifications = () => {
return(
    <div>
        <p>notifications</p>
    </div>
)
}

 export default notifications

projectlist.js

 import react from 'react'

 const projectlist = () => {
 return(
    <div>
        <div classname="project-list section">
            <div classname="card z-depth-0 project-summary">
                <div classname="card-content grey-text darken-3">
                    <span classname="card-title">project title</span>
                    <p>posted by net ninja</p>
                    <p classname="grey-text">3rd september, 2018</p>
                </div>
            </div>
        </div>
    </div>
)
}

export default projectlist

module name is react not react and since imports are case-sensitive import react from 'react' is causing error

score:1

so the issue is because you are not importing correctly. like in my case it was :

import {dropdown} from 'react-bootstrap'

i corrected it to

import {dropdown} from 'react-bootstrap'

since import statement are case sensitive

score:1

i had the same problem and it was because i imported react not react so it should go like this ..

import react from 'react'

score:1

you can try this solution from web-brackets.com
all you need to do is just rename the imported library from react to react with small r like this (on the first line)

import react from 'react';

reference https://web-brackets.com/discussion/6/-solved-cannot-find-file-index-js-does-not-match-the-corresponding-name-on-disk-react-js


Related Query

More Query from same tag