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
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?
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.