Home

Issue: 415

ReferenceError: self is not defined

[issue link]

I want to use http://element.eleme.io/#/en-US with nuxt, But when I config the loader like:

loaders: [
      {
        test: /\.css$/,
        loader: 'style-loader!css-loader'
      },
      {
        test: /\.(eot|svg|ttf|woff|woff2)(\?\S*)?$/,
        loader: 'file-loader'
      },
      {
        test: /\.(png|jpe?g|gif|svg)(\?\S*)?$/,
        loader: 'file-loader',
        query: {
          name: '[name].[ext]?[hash]'
        }
      }
    ]

I got the error ReferenceError: self is not defined, mybe conflict with nuxt.

when I remove this custome loaders, I got

Error: Module parse failed: /home/hxh/share/new-awesomes/node_modules/.1.2.5@element-ui/lib/theme-default/index.css Unexpected character '@' (1:0)

So this loaders must be added to the config to make element-ui work.

How I can resovle this error?

This question is available on Nuxt.js community (#c359)