I'm trying to do this in the head from nuxt.config.js
:
and create json file in the folder lang
import fs from 'fs'
import { db } from '../GUILLERMO-QUINTERO-ROJAS/services/firebase'
db.collection('english').doc('english').get().then((response) => {
fs.writeFile('lang/todos_1.json', JSON.stringify(response.data(), null, 2), 'utf-8', (err) => {
if (err) return console.log('An error happened', err)
console.log('File fetched from {JSON} Placeholder and written locally!')
})
})
I followed this example who works perfectly with axios request https://stackoverflow.com/a/67689890/16899587
It's showing me this erros:
Or when I tried with this: