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

fix(module): don't log fatal error when vuex is disabled #518

Merged
merged 1 commit into from Jan 13, 2020

Conversation

pimlie
Copy link
Member

@pimlie pimlie commented Jan 11, 2020

This would already help me fixing my issues using nuxt-auth with vue-stator

For laughs, this is what i do now to fix this:

buildModules: [
    async function fixNuxtAuth() {
      const authModulePath = require.resolve('@nuxtjs/auth/lib/module/index.js')
      const haystack = await fs.readFileSync(authModulePath, { encoding: 'utf8' })

      const needle = 'if (!this.options.store) {'
      const fixed = 'if (options.vuex && !this.options.store) {'

      if (!haystack.includes(needle)) {
        if (!haystack.includes(fixed)) {
          consola.error(`fix-nuxt-auth: needle & fixed both not found in haystack`)
        }
        return
      }

      const content = haystack.replace(needle, fixed)
      await fs.writeFile(authModulePath, content)
    },

@pimlie pimlie requested a review from pi0 January 11, 2020 17:43
@pi0
Copy link
Member

pi0 commented Jan 13, 2020

Thanks for PR @pimlie. BTW you can always point to GH fork in package.json :)

@pi0 pi0 changed the title fix: dont log fatal error when vuex is disabled fix(module): don't log fatal error when vuex is disabled Jan 13, 2020
@pi0 pi0 merged commit 59831fb into dev Jan 13, 2020
@pi0 pi0 deleted the fix-dont-show-vuex-fatal branch January 13, 2020 10:15
@pi0
Copy link
Member

pi0 commented Mar 15, 2020

Released with v4.9.0.

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

Successfully merging this pull request may close these issues.

None yet

2 participants