第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會有你想問的

部署到 firebase 函數(shù)時(shí)出現(xiàn)“無效或意外令牌”

部署到 firebase 函數(shù)時(shí)出現(xiàn)“無效或意外令牌”

陪伴而非守候 2023-03-03 16:11:15
我試圖將我的 react ssr 部署到 firebase 函數(shù),這個(gè)錯(cuò)誤出現(xiàn)在我身上,有人可以幫助我嗎?i  functions: Watching "C:\Users\LucasPereira\Documents\Dev\Site\ProIT\frontend\functions" for Cloud Functions...!  C:\Users\LucasPereira\Documents\Dev\Site\ProIT\frontend\functions\src\assets\gif_pro_it.gif:1GIF89aSyntaxError: Invalid or unexpected token    at wrapSafe (internal/modules/cjs/loader.js:1167:16)    at Module._compile (internal/modules/cjs/loader.js:1215:27)    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1272:10)    at Module.load (internal/modules/cjs/loader.js:1100:32)    at Function.Module._load (internal/modules/cjs/loader.js:962:14)    at Module.require (internal/modules/cjs/loader.js:1140:19)    at require (internal/modules/cjs/helpers.js:75:18)    at Object.<anonymous> (C:\Users\LucasPereira\Documents\Dev\Site\ProIT\frontend\functions\src\pages\Home\index.js:22:42)    at Module._compile (internal/modules/cjs/loader.js:1251:30)    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1272:10)!  We were unable to load your functions code. (see above)這是我的 index.tx(root)import * as functions from 'firebase-functions';import React from 'react';import { renderToString } from 'react-dom/server';import App from './src/App';import express from 'express';import fs from 'fs';const index = fs.readFileSync(__dirname + '/index.html', 'utf-8');const app = express();app.get('**', (req, res)=>{    const html = renderToString(<App />);    const finalHtml = index.replace('<div id="root"></div>', `<div id="root">${html}</div>`);    res.set('Cache-Control', 'public, max-age=600, s-maxage=1200');    res.send(finalHtml);})export let ssrapp = functions.https.onRequest(app);這是我的 firebase.json{  "hosting": {    "public": "dist",    "ignore": [      "firebase.json",      "**/.*",      "**/node_modules/**"    ]注意:我使用的是 express 4.17.1 和節(jié)點(diǎn)版本 14。主機(jī)運(yùn)行良好,我只是遇到功能問題編輯:我更改了“.gif”并且它繼續(xù)顯示錯(cuò)誤,所以我決定刪除它,僅用于調(diào)試,好吧,錯(cuò)誤繼續(xù)到另一個(gè)圖像(另一個(gè) PNG),錯(cuò)誤似乎在圖像中
查看完整描述

1 回答

?
九州編程

TA貢獻(xiàn)1785條經(jīng)驗(yàn) 獲得超4個(gè)贊

看起來您正在嘗試在某處導(dǎo)入 *.gif 圖像(但不在提供的代碼中);默認(rèn)情況下,不支持導(dǎo)入 GIF。

如果我是正確的,那么您需要設(shè)置Webpack(或其替代品)以處理 GIF 文件的導(dǎo)入。


查看完整回答
反對 回復(fù) 2023-03-03
  • 1 回答
  • 0 關(guān)注
  • 157 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號