Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

186
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda