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
.