nuxt-community / express-template

Starter template for Nuxt 2 with Express.

Home Page:https://codesandbox.io/s/github/nuxt-community/express-template

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Module exports

zakanybalazs opened this issue · comments

Hi I have already tried many ways of doing this, but always get the same error:

  • "export 'User' was not found in '@/accessers/ac_user.js'

@/accessers/ac_user.js

import fireconf from '~/firebase_conf.json';

module.exports = {
  User: (type, value) => {
    switch (type) {
      case 'uid':
        return axios.get(fireconf.getuser.uid.url);
      case 'email':
        return axios.get(fireconf.getuser.email.url);
    }
  }
}

Index.vue

import {User} from '@/accessers/ac_user.js';

nuxt.config.js

  modules: [
    '~/accessers/ac_user.js'
  ],

Also I have included in package.json the "babel-polyfill", because that's supposed to help. (it didn't)

Am I missing something?

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