Open Zidail opened 6 years ago
Are any of those dirs symlinks? What case sensitivity is your local fs and circle’s?
None of those directories are symlinked, but we do use Babel Plugin Module Resolver.
System (Mac) is case sensitive. CircleCI is linux so it should be case sensitive as well.
Thanks @ljharb !
That's not necessarily the case on either side; can you verify?
You're right. Double checked, System is case-insensitive. CircleCI is case sensitive.
In that case, if the path capitalizations don’t match precisely, they’d be failing correctly on circle CI.
I have the same problem too in my local machine (macOS High Sierra) it does not report any errors but on gitlab CI/CD it has this errors
> l192app@0.0.1 lint /builds/khmerload/l192-app
> eslint src/ __test__/ __mock__/
/builds/khmerload/l192-app/src/api/AccountAPI.js
4:29 error Unable to resolve path to module '../components' import/no-unresolved
4:29 error Missing file extension for "../components" import/extensions
/builds/khmerload/l192-app/src/components/ItemRender/CategoryList.js
3:29 error Unable to resolve path to module '../' import/no-unresolved
3:29 error Missing file extension for "../" import/extensions
/builds/khmerload/l192-app/src/components/ItemRender/ItemCart.js
3:31 error Unable to resolve path to module '../' import/no-unresolved
3:31 error Missing file extension for "../" import/extensions
/builds/khmerload/l192-app/src/components/ItemRender/ItemOrderHistory.js
5:31 error Unable to resolve path to module '..' import/no-unresolved
5:31 error Missing file extension for ".." import/extensions
/builds/khmerload/l192-app/src/components/ItemRender/SeeMore.js
3:29 error Unable to resolve path to module '../' import/no-unresolved
3:29 error Missing file extension for "../" import/extensions
/builds/khmerload/l192-app/src/components/ProductDetail.js
5:58 error Unable to resolve path to module '../components' import/no-unresolved
5:58 error Missing file extension for "../components" import/extensions
/builds/khmerload/l192-app/src/screens/Account/AccountScreen.js
3:62 error Unable to resolve path to module '../../components' import/no-unresolved
3:62 error Missing file extension for "../../components" import/extensions
/builds/khmerload/l192-app/src/screens/Account/ChangePasswordScreen.js
3:61 error Unable to resolve path to module '../../components' import/no-unresolved
3:61 error Missing file extension for "../../components" import/extensions
/builds/khmerload/l192-app/src/screens/Account/LogoutScreen.js
3:40 error Unable to resolve path to module '../../components' import/no-unresolved
3:40 error Missing file extension for "../../components" import/extensions
/builds/khmerload/l192-app/src/screens/Account/UpdateProfileScreen.js
5:62 error Unable to resolve path to module '../../components' import/no-unresolved
5:62 error Missing file extension for "../../components" import/extensions
/builds/khmerload/l192-app/src/screens/CartScreen.js
5:70 error Unable to resolve path to module '../components' import/no-unresolved
5:70 error Missing file extension for "../components" import/extensions
/builds/khmerload/l192-app/src/screens/Checkout/PaymentScreen.js
4:55 error Unable to resolve path to module '../../components' import/no-unresolved
4:55 error Missing file extension for "../../components" import/extensions
/builds/khmerload/l192-app/src/screens/Checkout/SuccessScreen.js
4:44 error Unable to resolve path to module '../../components' import/no-unresolved
4:44 error Missing file extension for "../../components" import/extensions
/builds/khmerload/l192-app/src/screens/CustomPageScreen.js
14:8 error Unable to resolve path to module '../components' import/no-unresolved
14:8 error Missing file extension for "../components" import/extensions
/builds/khmerload/l192-app/src/screens/Login/ChangePasswordScreen.js
4:44 error Unable to resolve path to module '../../components' import/no-unresolved
4:44 error Missing file extension for "../../components" import/extensions
/builds/khmerload/l192-app/src/screens/Login/ForgetPasswordScreen.js
4:57 error Unable to resolve path to module '../../components' import/no-unresolved
4:57 error Missing file extension for "../../components" import/extensions
/builds/khmerload/l192-app/src/screens/Login/LoginScreen.js
15:73 error Unable to resolve path to module '../../components' import/no-unresolved
15:73 error Missing file extension for "../../components" import/extensions
/builds/khmerload/l192-app/src/screens/Login/RegisterScreen.js
6:37 error Unable to resolve path to module '../../components' import/no-unresolved
6:37 error Missing file extension for "../../components" import/extensions
/builds/khmerload/l192-app/src/screens/Login/RegisterVerifyScreen.js
5:37 error Unable to resolve path to module '../../components' import/no-unresolved
5:37 error Missing file extension for "../../components" import/extensions
/builds/khmerload/l192-app/src/screens/Order/OrderDetailScreen.js
4:42 error Unable to resolve path to module '../../components' import/no-unresolved
4:42 error Missing file extension for "../../components" import/extensions
/builds/khmerload/l192-app/src/screens/Order/OrderHistoryScreen.js
10:8 error Unable to resolve path to module '../../components' import/no-unresolved
10:8 error Missing file extension for "../../components" import/extensions
/builds/khmerload/l192-app/src/screens/ProductScreen.js
5:72 error Unable to resolve path to module '../components' import/no-unresolved
5:72 error Missing file extension for "../components" import/extensions
/builds/khmerload/l192-app/src/screens/SearchScreen.js
15:76 error Unable to resolve path to module '../components' import/no-unresolved
15:76 error Missing file extension for "../components" import/extensions
/builds/khmerload/l192-app/src/screens/SideMenu/SideMenuScreen.js
13:49 error Unable to resolve path to module '../../components' import/no-unresolved
13:49 error Missing file extension for "../../components" import/extensions
On my local machine I got no errors
I also set my rule case sensitive to false
"import/no-unresolved": [2, { "caseSensitive": false }]
@james1888 Did you manage to get that working? I have the same problem on Gitlab. Lots of false positives. Possible related to symlinks.
Same problem here. no symlinks.
I was able to get around this by renaming my .js
files to .jsx
. I don't know why but it works with Circle Ci, even though I have these settings to resolve them and there is no problem on a local machine:
"settings": {
"react": {
"version": "detect"
},
"import/resolver": {
"node": {
"paths": ["client/src"],
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
}
},
same problem with gitlab CI
Did anyone solve this? I am having this issue on GitLab (Only)
We've specified a file using the current structure:
/src/libs/components/Form/template/TextBox/TextBox.js
Then import it in
/src/libs/components/Form/template/TextBox/index.js
as./TextBox
.Locally, we have no issues.
When we run it on CircleCI, it fails and gives two errors on the import:
import/no-unresolved
import/extensions
.When we change the file path to
/src/libs/components/Form/TextBox/index.js
by removingtemplate
it actually works and we don't get any errors.Any idea how to resolve this issue besides changing the file structure?