我一直在做一個簡單的React專案,名為Simple-portfolio,
。
Github repo。https://github.com/Devang47/simple-portfolio
實時網站網址。https://simple-portfolio.pages.dev/
這個專案在開發服務器中作業正常,但在構建應用程式后,在index.html中,指向其他檔案的鏈接變得錯誤。 例如:
//錯誤。
< link rel="icon" type="image/png" sizes="16x16" href=" 。 /simple-portfolio/favicon-16x16.png"/span>/>
預計。
< link rel="icon"/span> type="image/png" sizes="16x16" href=" 。 /favicon-16x16.png"/>。
生產構建控制臺的錯誤:
The script from "https:/simple-portfolio. pages.dev/simple-portfolio/static/js/3.f84cd7e8.chunk.js "被加載,盡管其MIME型別("text/html")不是有效的JavaScript MIME型別。
該腳本來自"https:/simple-portfolio.pages.dev/simple-portfolio/static/js/main.2 f259d87.chunk.js "被加載,盡管其MIME型別("text/html")不是有效的JavaScript MIME型別。
The stylesheet https://simple-portfolio.pages.dev/simple-portfolio/static/css/main.f6d0acc0.chunk.css 未被加載,因為其 MIME 型別為 "text/html",不是 "text/css"。
未捕獲 語法錯誤: 預期運算式,得到'< '
Uncaught SyntaxError: expected expression, got '< '
到目前為止,我所嘗試的是:
您的應用程式被部署到https://simple-portfolio.pages.dev/,這是域名的根,但homepage被設定為http://Devang47.github.io/simple-portfolio/,它有不同的路徑。
要解決這個問題,請從 package.json 中洗掉 homepage,重建您的應用程式,并將其重新部署到 Cloudflare Pages。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/306604.html
標籤:
上一篇:<p>我有一個小腳本,可以根據數字輸入的值在禁用和禁用之間切換一個按鈕。當事件觸發器為input.onchange時,它完全按照我的預期作業,但如果我嘗試將事件定為button.onmou
