title: TypeError: Cannot read property 'local' of undefined
body: <p>I am getting the following error in my project:</p>
  
  <pre><code>ModuleBuildError: Module build failed (from ./node_modules/next/dist/build/webpack/loaders/next-babel-loader.js):
  TypeError: Cannot read property 'local' of undefined`
  Here is my next.config.json
  `module.exports = {
    webpack: (config, { dev }) =&gt; {
      config.module.rules.push(
        {
          test: /\.(less)/,
          loader: 'emit-file-loader',
          options: {
            name: 'dist/[path][name].[ext]'
          }
        },
        {
          test: /\.less$/,
          use: [
            { loader: 'babel-loader' },
            { loader: 'raw-loader' },
            { loader: 'less-loader', options: { javascriptEnabled: true } }
          ]
        },
        {
          test: /\.css$/,
          exclude: /node_modules/,
          loader: [
            'css-loader?modules&amp;importLoaders=1&amp;localIdentName=[path]___[name]__[local]___[hash:base64:5]',
            'postcss-loader'
          ]
        }
      );
      return config;
    }
  };
  </code></pre>
  
  <p>And my .babelrc file:</p>
  
  <pre><code>{
    "plugins": [
      ["inline-import", { "extensions": [".css"] }],
      ["import", { "libraryName": "antd" }]
    ],
    "presets": ["next/babel"],
    "ignore": []
  }
  </code></pre>
  
  <p>I figured the problem comes up when importing packages:
  If i import packages in this manner it works:
  import module from package
  However, if I import the packages in this manner, I get the error described:
  import module from package/submodule
  Why is this happening? I suspect that the problem is with babel-loader but I don't have a clue on how to fix it.</p>
  
  <p>Thanks</p>