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

Failed to compile after install #4

Closed
cesoftinfo opened this issue Sep 22, 2017 · 10 comments
Closed

Failed to compile after install #4

cesoftinfo opened this issue Sep 22, 2017 · 10 comments

Comments

@cesoftinfo
Copy link

Can't start app?
./src/index.js
Module not found: Can't resolve 'containers/App/App.jsx'

@einazare
Copy link
Contributor

Hi @cesoftinfo . Can you verify if you have downloaded the whole project and if you have the App.jsx file in src/containers/App subfolder? If you have this file, than a problem that i can think of, is that the import line of App.jsx is wrong. You can change line 10 in src/index.js import App from 'containers/App/App.jsx'; with import App from './containers/App/App.jsx'; or with something similar. My guess is that it doesn't have the correct path to App.jsx.

@Arqu
Copy link

Arqu commented Sep 25, 2017

Have the same issue. I'm running on MacOS X Sierra and npm 5.4.2 with node 8.2.1. Changed the path for App to be relative, then variables from the App.jsx throw, adding ../../ there solves the issue, however more pop up. Seems like the relative paths need to be set up instead of absolute.
Possibly should add a path resolver to webpack.

For a temporary fix, I've gone to lbd-react-v1.0.0/node_modules/react-scripts/config and edited webpack.config.dev.js where I've added 'src' to the list of resolve modules on line 89 like this:

modules: ['node_modules', 'src', paths.appNodeModules].concat(
      // It is guaranteed to exist because we tweak it in `env.js`
      process.env.NODE_PATH.split(path.delimiter).filter(Boolean)
    ),

Started just fine after that. Hope this helps.

@yingkeen
Copy link

@Arqu thank you for the temp fix.

@cristijora
Copy link

cristijora commented Sep 25, 2017

@Arqu @yingkeen I would recommend against such edits inside node_modules since they are local and they will be overridden (deleted) once you install the project on another pc (a teammate wants to setup the project for example) or for some reason you delete node_modules or you want to update some packages which update react-scripts.

I would rather try one of the following things

  1. Change NODE_PATH=src to NODE_PATH=./src inside .env file
  2. Change react-scripts start to cross-env NODE_PATH=./src react-scripts start inside package.json

The second option would require cross-env to be installed globally

@Arqu
Copy link

Arqu commented Sep 26, 2017

Agree completely, thats why this was a temporary workaround just to get it going. Thanks for showing the proper way do it still getting a grasp of react.

@maverickdude
Copy link

@cristijora Thank you so much. I tried with .env and it worked.
I'm too grasping the concepts of react and JS world.

@cesoftinfo
Copy link
Author

Installing cross-env and changing react-scripts start to cross-env NODE_PATH=./src react-scripts start inside package.json workerd for me.Thanks.

@jlbooker
Copy link

jlbooker commented Oct 5, 2017

Had this same problem too when using the .zip bundle download. I deleted the files from the .zip release, then cloned the project from GitHub and everything seems to work.

It looks like the .env file is not included in the .zip bundle, but is included in the repo.

@faisy26
Copy link

faisy26 commented Dec 17, 2019

i also have same problem and i try all solution but it did'nt work
can anyone tell?
problem: Failed to compile
./src/index.js
Module not found: Can't resolve 'assets/css/argon-dashboard-react.css' in 'F:\SKILLS\React\project\src'
This error occurred during the build time and cannot be dismissed.

@einazare
Copy link
Contributor

i also have same problem and i try all solution but it did'nt work
can anyone tell?
problem: Failed to compile
./src/index.js
Module not found: Can't resolve 'assets/css/argon-dashboard-react.css' in 'F:\SKILLS\React\project\src'
This error occurred during the build time and cannot be dismissed.

Hello there, @faisy26 ,

Your error says argon-dashboard-react.
We are on the Light Bootstrap Dashboard React product.
Could you please provide us with the following video:

  • Download the product
  • Unzip the product
  • Open terminal and cd into the project
  • [If on Mac, Linux or Ubuntu Systems] Run npm run install:clean
  • [If on Windows Systems] Run npm install
  • [If on Windows Systems] Run npm start
  • Showcase the issue

Best,
Manu

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

No branches or pull requests

8 participants