{"action":"created","issue":{"url":"https://api.github.com/repos/webpack/webpack/issues/4315","repository_url":"https://api.github.com/repos/webpack/webpack","labels_url":"https://api.github.com/repos/webpack/webpack/issues/4315/labels{/name}","comments_url":"https://api.github.com/repos/webpack/webpack/issues/4315/comments","events_url":"https://api.github.com/repos/webpack/webpack/issues/4315/events","html_url":"https://github.com/webpack/webpack/issues/4315","id":208873326,"number":4315,"title":"Webpack tries to use less module as less-loader","user":{"login":"larsbs","id":1436588,"avatar_url":"https://avatars.githubusercontent.com/u/1436588?v=3","gravatar_id":"","url":"https://api.github.com/users/larsbs","html_url":"https://github.com/larsbs","followers_url":"https://api.github.com/users/larsbs/followers","following_url":"https://api.github.com/users/larsbs/following{/other_user}","gists_url":"https://api.github.com/users/larsbs/gists{/gist_id}","starred_url":"https://api.github.com/users/larsbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larsbs/subscriptions","organizations_url":"https://api.github.com/users/larsbs/orgs","repos_url":"https://api.github.com/users/larsbs/repos","events_url":"https://api.github.com/users/larsbs/events{/privacy}","received_events_url":"https://api.github.com/users/larsbs/received_events","type":"User","site_admin":false},"labels":[{"id":1089820,"url":"https://api.github.com/repos/webpack/webpack/labels/bug","name":"bug","color":"fbca04","default":true},{"id":90419071,"url":"https://api.github.com/repos/webpack/webpack/labels/webpack-2","name":"webpack-2","color":"c5def5","default":false},{"id":433394206,"url":"https://api.github.com/repos/webpack/webpack/labels/X1:%20Inspection%20required","name":"X1: Inspection required","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-02-20T13:00:16Z","updated_at":"2017-02-21T15:04:26Z","closed_at":null,"body":"<!-- Please don't delete this template or we'll close your issue -->\r\n<!-- Before creating an issue please make sure you are using the latest version of webpack. -->\r\n<!-- Also consider trying the webpack@beta version, maybe it's already fixed. -->\r\n\r\n**Do you want to request a *feature* or report a *bug*?**\r\n\r\nReport a bug\r\n\r\n<!-- Please ask questions on StackOverflow or the webpack Gitter (https://gitter.im/webpack/webpack). -->\r\n<!-- Issues which contain questions or support requests will be closed. -->\r\n\r\n**What is the current behavior?**\r\n\r\nI'm trying to use `less-loader` in a webpack configuration but when running webpack, it's trying to use the `less` module. So it's giving me the following error: `Error: Module '/path/to/project/node_modules/less/index.js' is not a loader (must have normal or pitch function)`. This is suppose to happen if a configure `less` as loader instead of `less-loader`, but I have it configured correctly.\r\n\r\n**If the current behavior is a bug, please provide the steps to reproduce.**\r\n\r\nAdd **less** and **less-loader** and try to compile. This is my full config: \r\n\r\n```\r\nconst path = require('path');\r\nconst webpack = require('webpack');\r\nconst autoprefixer = require('autoprefixer');\r\nconst cssnano = require('cssnano');\r\nconst packageJson = require('./package.json');\r\n\r\n\r\nconst rootDirs = [\r\n  path.resolve(__dirname, 'app'),\r\n  path.resolve(__dirname, 'test'),\r\n  path.resolve(__dirname, 'vendor'),\r\n];\r\n\r\n\r\nmodule.exports = {\r\n  resolve: {\r\n    modules: [\r\n      ...rootDirs,\r\n      path.resolve(__dirname, 'public'),\r\n      'node_modules',\r\n    ],\r\n    extensions: ['.js', '.jsx', '.less'],\r\n  },\r\n  entry: {\r\n    frontoffice: [ './app/app.jsx' ],\r\n  },\r\n  output: {\r\n    path: path.resolve(__dirname, '../builds'),\r\n    publicPath: '/',\r\n    filename: '[name].entry.js'\r\n  },\r\n  plugins: [\r\n    //new webpack.DefinePlugin({\r\n      //'process.env': { APP_VERSION: JSON.stringify(packageJson.version) },\r\n    //}),\r\n  ],\r\n  module: {\r\n    rules: [\r\n      {\r\n        test: /\\.jsx?$/,\r\n        include: rootDirs,\r\n        use: [\r\n          {\r\n            loader: 'babel-loader',\r\n            options: {\r\n              presets: [ ['es2015', { modules: false }], 'stage-0', 'react' ],\r\n            },\r\n          }\r\n        ],\r\n      },\r\n      {\r\n        test: /\\.css$/,\r\n        use: [\r\n          {\r\n            loader: 'style-loader',\r\n          },\r\n          {\r\n            loader: 'css-loader',\r\n            options: {\r\n              sourceMap: true,\r\n              localIndentName: '[name]__[local]--[hash:base64:5]',\r\n            },\r\n          },\r\n          {\r\n            loader: 'postcss-loader',\r\n            options: {\r\n              sourceMap: true,\r\n              plugins: () => [ autoprefixer, cssnano({ safe: true}) ],\r\n            },\r\n          },\r\n        ]\r\n      },\r\n      {\r\n        test: /\\.less$/,\r\n        use: [\r\n          {\r\n            loader: 'style-loader',\r\n          },\r\n          {\r\n            loader: 'css-loader',\r\n            options: {\r\n              sourceMap: true,\r\n              localIndentName: '[name]__[local]--[hash:base64:5]',\r\n            },\r\n          },\r\n          {\r\n            loader: 'postcss-loader',\r\n            options: {\r\n              sourceMap: true,\r\n              plugins: () => [ autoprefixer, cssnano({ safe: true}) ],\r\n            },\r\n          },\r\n          {\r\n            loader: 'less-loader',\r\n            options: {\r\n              sourceMap: true,\r\n            },\r\n          }\r\n        ]\r\n      },\r\n      {\r\n        test: /\\.woff([^2].*)?$/,\r\n        use: [\r\n          {\r\n            loader: 'file-loader',\r\n            options: {\r\n              name: '/[name].[ext]',\r\n            },\r\n          },\r\n        ]\r\n      },\r\n      {\r\n        test: /\\.woff2(.*)?$/,\r\n        use: [\r\n          {\r\n            loader: 'file-loader',\r\n          }\r\n        ],\r\n      },\r\n      {\r\n        test: /\\.ttf(.*)?$/,\r\n        use: [\r\n          {\r\n            loader: 'url-loader',\r\n            options: {\r\n              limit: 10000,\r\n              mimetype: 'application/octet-stream',\r\n            },\r\n          },\r\n        ],\r\n      },\r\n      {\r\n        test: /\\.eot(.*)?$/,\r\n        use: [\r\n          {\r\n            loader: 'file-loader',\r\n          }\r\n        ],\r\n      },\r\n      {\r\n        test: /\\.otf$/,\r\n        use: [\r\n          {\r\n            loader: 'url-loader',\r\n            options: {\r\n              limit: 10000,\r\n              mimetype: 'application/octet-stream',\r\n            },\r\n          },\r\n        ],\r\n      },\r\n      {\r\n        test: /\\.svg(.*)?$/,\r\n        use: [\r\n          {\r\n            loader: 'url-loader',\r\n            options: {\r\n              limit: 10000,\r\n              mimetype: 'image/svg+xml',\r\n            },\r\n          },\r\n        ],\r\n      },\r\n      {\r\n        test: /\\.jpg$/,\r\n        use: [\r\n          {\r\n            loader: 'url-loader',\r\n            options: {\r\n              limit: 10000,\r\n              mimetype: 'image/jpg',\r\n            },\r\n          },\r\n        ],\r\n      },\r\n      {\r\n        test: /\\.png$/,\r\n        use: [\r\n          {\r\n            loader: 'url-loader',\r\n            options: {\r\n              limit: 10000,\r\n              mimetype: 'image/png',\r\n            },\r\n          },\r\n        ],\r\n      },\r\n    ],\r\n  },\r\n};\r\n```\r\n\r\nAnd these are the versions of the relevant packages: \r\n\r\n```\r\n \"less\": \"^2.7.2\",\r\n \"less-loader\": \"^2.2.3\",\r\n \"webpack\": \"^2.2.1\",\r\n \"webpack-dev-server\": \"^2.3.0\"\r\n```\r\n\r\n<!-- A great way to do this is to provide your configuration via a GitHub gist. -->\r\n<!-- Best provide a minimal reproduceable repo -->\r\n<!-- If your issue is caused by a plugin or loader file the issue on the plugin/loader repo -->\r\n\r\n**What is the expected behavior?**\r\n\r\nIt should compile the bundle.\r\n\r\n**If this is a feature request, what is motivation or use case for changing the behavior?**\r\n\r\n**Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.**\r\n"},"comment":{"url":"https://api.github.com/repos/webpack/webpack/issues/comments/281369696","html_url":"https://github.com/webpack/webpack/issues/4315#issuecomment-281369696","issue_url":"https://api.github.com/repos/webpack/webpack/issues/4315","id":281369696,"user":{"login":"larsbs","id":1436588,"avatar_url":"https://avatars.githubusercontent.com/u/1436588?v=3","gravatar_id":"","url":"https://api.github.com/users/larsbs","html_url":"https://github.com/larsbs","followers_url":"https://api.github.com/users/larsbs/followers","following_url":"https://api.github.com/users/larsbs/following{/other_user}","gists_url":"https://api.github.com/users/larsbs/gists{/gist_id}","starred_url":"https://api.github.com/users/larsbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larsbs/subscriptions","organizations_url":"https://api.github.com/users/larsbs/orgs","repos_url":"https://api.github.com/users/larsbs/repos","events_url":"https://api.github.com/users/larsbs/events{/privacy}","received_events_url":"https://api.github.com/users/larsbs/received_events","type":"User","site_admin":false},"created_at":"2017-02-21T15:04:26Z","updated_at":"2017-02-21T15:04:26Z","body":"Ok, my bad. The problem was that somewhere deep in the code, there were some calls to `less-loader` directly when importing some files, but those calls were written without the `-loader` part."}}
{"actor":{"display_login":"larsbs"}}