Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

eslint error import/no-unresolved

Fara March 14, 2019

For my React app, my .env file has the following entry:


NODE_PATH=./src

This allows me to use absolute paths when importing packages.

In eslintrc.json, I have this configuration to handle eslint's import/no-unresolved rule:

 "settings": { "import/resolver": { "node": { "paths": ["src"] } } },

This set up works in my local environment.

However, when I push my code to Bitbucket, the build fails with this message:

 

error Unable to resolve path to module 'components/Header/Header' import/no-unresolved


Would anyone know how to solve this problem?

Thanks!

Fara

1 answer

0 votes
mkleint
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 21, 2019

where does your .env reside on your local machine? does the bitbucket pipelines docker image you are using contain the same file at the right location?

Same with eslintrc.json. Is that file present in the same way in your local dev environment and in pipelines environment?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events