Я работаю над развертыванием в Heroku и продолжаю работать после сценария Heroku Post Build во время сборки.
Вот ошибка:
Counting objects: 31, done.
Delta compression using up to 8 threads.
Compressing objects: 33% (10/30) Compressing objects: 36% (11/30) Comp(13/30) Compressing objects: 46% (14/30) Compressing objects: 50% (15/cts: 56% (17/30) Compressing objects: 60% (18/30) Compressing objects:ssing objects: 70% (21/30) Compressing objects: 73% (22/30) Compressin) Compressing objects: 83% (25/30) Compressing objects: 86% (26/30) 93% (28/30) Compressing objects: 96% (29/30) Compressing objects: 100% Writing objects: 100% (31/31), 3.11 KiB | 795.00 KiB/s, done.
Total 31 (delta 24), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote: NODE_VERBOSE=false
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): 8.11.1
remote: engines.npm (package.json): unspecified (use default)
remote:
remote: Resolving node version 8.11.1...
remote: Downloading and installing node 8.11.1...
remote: Using default npm version: 5.6.0
remote:
remote: -----> Installing dependenciesremote: Installing node modules (package.json + package-lock)
remote:
remote: > nodemon@1.18.3 postinstall /tmp/build_cd1ff6a12b14a1453b116
remote: > node bin/postinstall || exit 0remote:
remote: Love nodemon? You can now support the project via the open co
remote: > https://opencollective.com/nodemon/donate
remote:
remote: added 416 packages in 10.469s
remote:
remote: -----> Build
remote: Running heroku-postbuild
remote:
remote: > mernsocial@1.0.0 heroku-postbuild /tmp/build_cd1ff6a12b14a1
remote: > NPM_CONFIG_PRODUCTION=false npm install --prefix client &&
remote:
remote: added 1876 packages in 59.275s
remote:
remote: > client@0.1.0 build /tmp/build_cd1ff6a12b14a1453b116a9ef5be2
remote: > react-scripts build
remote:
remote: Creating an optimized production build...
remote: Failed to compile.
remote:
remote: ./src/components/dashboard/Dashboard.js
remote: Cannot find file '../common/Spinner' in './src/components/das
remote:
remote:
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! client@0.1.0 build: `react-scripts build`
remote: npm ERR! Exit status 1
remote: npm ERR!
remote: npm ERR! Failed at the client@0.1.0 build script.ript. npm. There is likely ad
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output abovound in:e. 03-21T21_04_29_943Z-debu
remote:
remote: npm ERR! A complete log of this run can be found in: `NPM_CONFIG_PRODUCTION=fremote: npm ERR! /tmp/npmcache.Ac1YO/_logs/2019-03-21T21_04_29_943Z-debug.log
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1 ku-postbuild script.
remote: npm ERR! mernsocial@1.0.0 heroku-postbuild: npm. There is likely ad
`NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client` ound in:
remote: npm ERR! Exit status 1 03-21T21_04_29_957Z-debu
remote: npm ERR!
remote: npm ERR! Failed at the mernsocial@1.0.0 heroku-postbuild script. " script defined in pack
remote: npm ERR! This is probably not a problem with npm. There is likely ad is likely additional logging output above.remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.Ac1YO/_logs/2019-03-21T21_04_29_957Z-debu_29_957Z-debug.log
remote:remote: -----> Change to Node.js build process fined in pack
remote: Heroku has begun executing the "build" script defined in package.json
remote: during Node.js builds.remote:
remote: Read more: https://devcenter.heroku.com/changelog-items/1573heroku.com/changelog-items/1573
remote:remote:
remote: -----> Build failed
remote:remote: We're sorry this build is failing! You can troubleshoot common issues here:remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploysremote:remote: If you're stuck, please submit a ticket so we can help:remote: https://help.heroku.com/remote:remote: Love,remote: Herokuremote:
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
remote: Verifying deploy...remote:remote: ! Push rejected to agile-shelf-15554.remote:
To https://git.heroku.com/agile-shelf-15554.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/agile-shelf-15554.git'
I double checked my Spinner Component, and the importation of the Spinner module.
Вот копия структуры моей папки:
Я проверил, чтобы убедиться, что я также импортировал модуль Spinner:
Вот импорт модуля в файле Dashboard.js в каталоге dashboard:
import React, { Component } from 'react';
import { PropTypes } from 'prop-types';
import { connect } from 'react-redux';
import { getCurrentProfile, deleteAccount } from '../../actions/profileActions';
import { Link } from 'react-router-dom';
import ProfileActions from './ProfileActions';
import Spinner from '../common/Spinner';
import Experience from './Experience';
import Education from './Education';
Я также вернулся к двойной проверке экспорта модуля Spinner:
Вот код модуля Spinner:
import React from 'react';
import spinner from './spinner.gif';
export default () => {
return (
<div>
<img
src={spinner}
style={{ width: '200px', margin: 'auto', display: 'block' }}
alt="Loading....."
/>
</div>
);
};
Я проверил StackOverFlow и несколько GitDocs, и у других были похожие проблемы со структурой файлов и пост-сборкой для других приложений, но некоторые из этих решений (вращающиеся вокруг перехода на heroku из другой ветки) не были плодотворными для меня.
Кроме того, я могу построить его локально, без ошибок.
Любая помощь приветствуется, поэтому я могу завершить этот проект.
Спасибо,