Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

191
Vistas
nuxt.config.js cannot use import statement outside a module, import colors from 'vuetify/es5/util/colors'

I'm trying to deploy function only to firebase, here is the error:

+  functions: required API cloudfunctions.googleapis.com is enabled

Error: Error occurred while parsing your function triggers.

C:\Users\User\Documents\someapps\functions\nuxt.config.js:1
import colors from 'vuetify/es5/util/colors'
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1025:15)
    at Module._compile (node:internal/modules/cjs/loader:1059:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1124:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:816:12)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:93:18)

The main error is: SyntaxError: Cannot use import statement outside a module.

Important part of the nuxt.config.js:

import colors from 'vuetify/es5/util/colors'

export default {
  vuetify: {
    customVariables: ['~/assets/variables.scss'],
    theme: {
      dark: false,
      themes: {
        light: {
          info: colors.teal.lighten1,
          warning: colors.amber.base,
        }
      }
    }
  }
}

The colors used by vuetify config among others, how to refactor import colors without error?

I've tried:

Transpile like the documentation suggest :

build: {
    transpile: ['vuetify/es5/util/colors'],
}

The error changed to ReferenceError: colors is not defined since I dunno where/how to define the colors without the import.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda