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

Error when running the project 'Unable to resolve path to module' #233

Closed
fluturecode opened this issue Jun 30, 2021 · 12 comments
Closed

Error when running the project 'Unable to resolve path to module' #233

fluturecode opened this issue Jun 30, 2021 · 12 comments
Assignees
Labels
bug Something isn't working

Comments

@fluturecode
Copy link
Contributor

Describe the bug

After running [yarn start] and error occurs flagging the 'import/no-unresolved' lint error.

Expected behavior

The project should run with no errors.

To Reproduce

Steps to reproduce the behavior:

  1. Pull from Development.
  2. Run [yarn start]

Screenshots

Screen Shot 2021-06-30 at 5 12 02 PM

@fluturecode fluturecode added the bug Something isn't working label Jun 30, 2021
@fluturecode fluturecode self-assigned this Jun 30, 2021
@michaelachrisco
Copy link
Contributor

michaelachrisco commented Jun 30, 2021

Im wondering if the node_modules are not pulling in the correct dependencies/modules?

Can you try to reinstall yarn via yarn install or just yarn?

If that doesn't work and you get the same error, try removing node_modules and reinstalling from there. If you are still having issues. If after all that, we may need to take a look at node version and npx.

Ill attempt the same with a blank repo and see if I get the same error.

@michaelachrisco
Copy link
Contributor

Brand new repo, im getting the following error:

$ yarn start
yarn run v1.22.5
warning ../package.json: No license field
$ cross-env PORT=4200 react-scripts start
/bin/sh: 1: cross-env: not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Im going to try and installing cross-env and see what pops up.

@michaelachrisco
Copy link
Contributor

Ah cross-env is in devDependencies. We should probably move that to dependencies if its to get the start operation working.

@michaelachrisco
Copy link
Contributor

michaelachrisco commented Jun 30, 2021

Interesting! So when I tried to install the dependencies for the repo, it looks like if you have NODE_ENV=production then yarn does not install the devDependencies but if you have NODE_ENV=develop or anything other than production, the devDependencies get installed. I had no idea this was a thing.

Relevant documentation here: yarnpkg/yarn#2739

Can you try this?

NODE_ENV=develop
yarn
yarn start

This should be added to the repo. I would expect yarn start to have everything it needs from the base install rather than using devDependencies. We will need to change that in the package.json.

@michaelachrisco michaelachrisco added this to To do in QA Sprint #5 - 6/22 - 7/6 via automation Jul 1, 2021
@fluturecode
Copy link
Contributor Author

Im wondering if the node_modules are not pulling in the correct dependencies/modules?

Can you try to reinstall yarn via yarn install or just yarn?

If that doesn't work and you get the same error, try removing node_modules and reinstalling from there. If you are still having issues. If after all that, we may need to take a look at node version and npx.

Ill attempt the same with a blank repo and see if I get the same error.

Yes I had tried that and it didn't help.

@fluturecode
Copy link
Contributor Author

Interesting! So when I tried to install the dependencies for the repo, it looks like if you have NODE_ENV=production then yarn does not install the devDependencies but if you have NODE_ENV=develop or anything other than production, the devDependencies get installed. I had no idea this was a thing.

Relevant documentation here: yarnpkg/yarn#2739

Can you try this?

NODE_ENV=develop
yarn
yarn start

This should be added to the repo. I would expect yarn start to have everything it needs from the base install rather than using devDependencies. We will need to change that in the package.json.

Ok so I will make a PR for this today.

@fluturecode
Copy link
Contributor Author

NODE_ENV=develop

Where should I add this for documentation?

@michaelachrisco
Copy link
Contributor

NODE_ENV=develop

Where should I add this for documentation?

Im not sure. I would expect yarn install to contain everything needed to do yarn start without the need of development dependencies cluttering the production install. If we do need to add it to the docs, I would suggest adding it under Local Development.

@AramayisO
Copy link
Contributor

@michaelachrisco @fluturecode You can't set NODE_ENV manually. It is set by Node depending on how the process was started. If you run yarn start then NODE_ENV is set to development. If you run yarn build then it is set to production.

@fluturecode fluturecode removed their assignment Jul 6, 2021
@fluturecode
Copy link
Contributor Author

Moved cross-env to dependencies as part of PR #241, which was merged into dev. Other issue still needs to be addressed.

@michaelachrisco
Copy link
Contributor

@fluturecode Do we think this issue is complete or do we have anything else we need to add at this point?

@michaelachrisco michaelachrisco added this to To do in Sprint #11: 9/14-9/28 via automation Sep 27, 2021
@fluturecode
Copy link
Contributor Author

This has been resolved. Pull down the project and run yarn and then yarn start.

Sprint #11: 9/14-9/28 automation moved this from To do to Done Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Development

No branches or pull requests

3 participants