-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Configuration files not found when importing a file from outside the current project folder #2539
Comments
Maybe it's just a configuration issue (a parameter somewhere that I missed), or maybe I should open an issue on While I'm waiting for some guidance, I did the below workaround. I changed const directory = filePath ? path.dirname(filePath) : this.options.cwd; to: const directory = this.options.cwd; I changed path = path ? resolve(path) : process.cwd() to: path = process.cwd() It's clearly not a good workaround, but at least it works for now... |
You can force ESLint to use a specific config with |
Thanks Akryum for pointing me to the right direction! Here is the required configuration in const path = require('path');
module.exports = {
chainWebpack: config => {
config.module
.rule('eslint')
.use('eslint-loader')
.tap(options => {
options.configFile = path.resolve(__dirname, ".eslintrc.js");
return options;
})
},
css: {
loaderOptions: {
postcss: {
config:{
path:__dirname
}
}
}
}
} |
I resolved this by placing a |
Getting this same issue for when I error in /Users/darrenjennings/source/repos/kong-ui-plugin-audit-logs/pages/List.vue?vue&type=style&index=0&lang=css&
Module build failed (from ./node_modules/postcss-loader/lib/index.js):
Error: No PostCSS Config found in: /Users/darrenjennings/source/repos/kong-ui-plugin-audit-logs/pages
at config.load.then (/Users/darrenjennings/source/repos/kong-ee-vagrant/kong-admin/node_modules/postcss-load-config/src/index.js:55:15)
at <anonymous> Adding a blank |
Just bumped into this after converting to yarn workspaces where the server side app and front end (vue) app are in subfolders. Thanks @Akryum for the tip and @Aymkdn for the example. It was a drop in 👍 |
Version
3.0.3
Reproduction link
https://github.com/Aymkdn/vue-cli-error
Node and OS info
Node 8.11.4 / npm 5.6.0 / Windows 10
Steps to reproduce
My structure is the one below:
demo
has been created withvue create demo
. I use the default settings. I've only changed thesrc/App.vue
file (see below)In
App.vue
I'd like to refer the fileparent/common/Example.vue
(in code):Then if I run
npm run serve
I receive the below error:I tried to ignore ESLint but then I receive an error from PostCSS :
What is expected?
I'd assume it would use the current project's config files to import files from somewhere else.
So using the current ESLint and other configurations defined in the current project.
What is actually happening?
The program tries to find configuration files from the outside folder instead of using its own config files, and because it cannot find them it fails.
I need that because I have the same code I'll need to import for different projects.
The behavior is the same with a simple JS file.
I also tried with a webpack alias, but same error.
Thank you.
The text was updated successfully, but these errors were encountered: