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

Composes does not work with css-loader/locals #537

Closed
DylanPiercey opened this issue May 22, 2017 · 4 comments
Closed

Composes does not work with css-loader/locals #537

DylanPiercey opened this issue May 22, 2017 · 4 comments

Comments

@DylanPiercey
Copy link

DylanPiercey commented May 22, 2017

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Currently when you use composes: x from './y.css' using the css-loader/locals plugin for server side rendering it creates a circular dependency no matter what.

If the current behavior is a bug, please provide the steps to reproduce.
Loader config:

{
  test: /\.css$/,
  exclude: /node_modules/,
  use: {
    loader: 'css-loader/locals',
    modules: true,
    sourceMap: true
  }
}

What is the expected behavior?
That only a circular dependency would error. (Note there is no error displayed any required module just will not resolve).

Please mention other relevant information such as your webpack version, Node.js version and Operating System.
webpack v2x, node 7, macOS

@pixelass
Copy link

pixelass commented Jun 7, 2017

I'm not sure if this is related but composes from another file seem not to be resolved.

.wrapper {
	composes: grid from './foo.less';
}

.nav {
	composes: wrapper;
	/* footer nav element */
}

.socialNav {
	/* footer social nav element */
}

.brandNav {
	/* footer brand nav element */
}
// exports
exports.locals = {
	"wrapper": "e9oiFTlAUxvsYfN3AXVAS " + require("-!../../../../../../../node_modules/css-loader/index.js?{\"modules\":true,\"sourceMap\":true}!./foo.less").locals["grid"] + "",
	"nav": "bUQCLkB65igesOUztxpHc e9oiFTlAUxvsYfN3AXVAS " + require("-!../../../../../../../node_modules/css-loader/index.js?{\"modules\":true,\"sourceMap\":true}!./foo.less").locals["grid"] + "",
	"socialNav": "_2q5ZQPrp57ZlshW3-oXSG-",
	"brandNav": "_36BcBteQRXzJN_Cv-6lehZ"
};

@alexander-akait
Copy link
Member

@DylanPiercey @pixelass problem still exists? If yes can you create minimum reproducible test repo?

@pixelass
Copy link

@evilebottnawi I don't use this mechanism anymore. I think I figured it out somehow and AFAIR it was a problem in my implementation.

@alexander-akait
Copy link
Member

Closing due to inactivity. Please test with latest version and feel free to reopen if still regressions. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants