nuxt-community / starter-template

DEPRECATED: use create-nuxt-app instead
https://github.com/nuxt-community/create-nuxt-app
MIT License
607 stars 330 forks source link

module build failed #82

Closed Rush-YL closed 6 years ago

Rush-YL commented 6 years ago

Module build failed (from ./node_mdules/eslint-loader/index.js): TypeError: Cannot read property 'eslint' of undefined at Object.module.exports

This question is available on Nuxt community (#c57)
ghost commented 6 years ago

This issue as been imported as question since it does not respect starter-template issue template. Only bug reports and feature requests stays open to reduce maintainers workload. If your issue is not a question, please mention the repo admin or moderator to change its type and it will be re-opened automatically. Your question is available at https://cmty.app/nuxt/starter-template/issues/c57.

aeksco commented 6 years ago

10/23/18 Edit: the comment below is incorrect - apologies for misleading anyone!

~@Rush-YL~

~Remove ctx.isClient and replace with process.client in nuxt-config.js:~

extend (config, { isDev }) {
  if (isDev && process.client) {
    config.module.rules.push({
      enforce: 'pre',
      test: /\.(js|vue)$/,
      loader: 'eslint-loader',
      exclude: /(node_modules)/
    })
  }
}

Source

XanderLuciano commented 6 years ago

@aeksco This is incorrect and process.client will be undefined.

NicoPennec commented 6 years ago

this issue is fixed by the following PR: https://github.com/nuxt-community/starter-template/pull/86

please, don't apply the @aeksco's proposal !

aeksco commented 6 years ago

@XanderLuciano @NicoPennec Apologies for the misleading comment - I've updated my post directing people not to follow those instructions. Thanks for posting about the fix :)