Я создал приложение MERN, которое отлично работает на localhost. Когда я развертываю то же самое в heroku, у него была проблема при loadUser, он не мог получить объект пользователя, вместо этого получил html код (см. Рисунок ниже)
не может получить пользователя, он получает html код
Ссылка на приложение: https://tuong-instagram.herokuapp.com/
Ссылка на репо: https://github.com/huynhdieutuong/MERN_Instagram-Clone
Пожалуйста, помогите мне . Спасибо!
Журнал сборки
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_ENV=production
NODE_MODULES_CACHE=true
NODE_VERBOSE=false
-----> Installing binaries
engines.node (package.json): unspecified
engines.npm (package.json): unspecified (use default)
Resolving node version 12.x...
Downloading and installing node 12.16.3...
Using default npm version: 6.14.4
-----> Restoring cache
- node_modules
-----> Installing dependencies
Installing node modules (package.json + package-lock)
audited 275 packages in 2.24s
12 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
-----> Build
Running heroku-postbuild
> instagram_clone@1.0.0 heroku-postbuild /tmp/build_50c620997e1e9cf5e52b891e82486dda
> NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client
> core-js@2.6.11 postinstall /tmp/build_50c620997e1e9cf5e52b891e82486dda/client/node_modules/babel-runtime/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
> core-js@3.6.5 postinstall /tmp/build_50c620997e1e9cf5e52b891e82486dda/client/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
> core-js-pure@3.6.5 postinstall /tmp/build_50c620997e1e9cf5e52b891e82486dda/client/node_modules/core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"
added 1734 packages from 828 contributors and audited 1739 packages in 46.142s
60 packages are looking for funding
run `npm fund` for details
found 1 low severity vulnerability
run `npm audit fix` to fix them, or `npm audit` for details
> client@0.1.0 build /tmp/build_50c620997e1e9cf5e52b891e82486dda/client
> react-scripts build
Creating an optimized production build...
Compiled successfully.
File sizes after gzip:
151.36 KB build/static/js/2.bcf86cda.chunk.js
63.06 KB build/static/css/2.4c6ee7a4.chunk.css
13.51 KB build/static/js/main.ffa55597.chunk.js
4.28 KB build/static/css/main.30d556c6.chunk.css
774 B build/static/js/runtime-main.8c40394c.js
The project was built assuming it is hosted at /.
You can control this with the homepage field in your package.json.
The build folder is ready to be deployed.
You may serve it with a static server:
npm install -g serve
serve -s build
Find out more about deployment here:
bit.ly/CRA-deploy
-----> Caching build
- node_modules
-----> Pruning devDependencies
removed 172 packages and audited 102 packages in 3.444s
1 package is looking for funding
run `npm fund` for details
found 0 vulnerabilities
-----> Build succeeded!
-----> Discovering process types
Procfile declares types -> (none)
Default types for buildpack -> web
-----> Compressing...
Done: 81.2M
-----> Launching...
Released v4
https://tuong-instagram.herokuapp.com/ deployed to Heroku