簡體   English   中英

部署React App返回`此頁面正在使用React的開發版本,盡管已經執行`npm run build`。

[英]Deploy React App Return `This page is using the development build of React`despite already executing `npm run build`

目前,我正在創建一個簡單的react應用程序,如您在https://selly-midtrans.herokuapp.com/中所見,但是當我部署它時,它給了我一些錯誤 在此處輸入圖片說明

而且我已經遵循了這個https://reactjs.org/docs/optimizing-performance.html#use-the-production-build,所以我運行heroku run npm run build但它似乎並沒有改變我的生產

有什么建議嗎? 我將非常感謝您的任何建議

默認的heroku buildpack將運行npm start ,它將啟動開發服務器。

您需要使用https://github.com/mars/create-react-app-buildpack ,它實際上將構建應用程序的生產版本並提供靜態資產。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM