尝试将我的 vue-cli 应用程序部署到 heroku 时遇到了困难

2023-12-24

我已按照以下教程中的具体说明进行操作:

https://codeburst.io/quick-n-clean-way-to-deploy-vue-webpack-apps-on-heroku-b522d3904bc8 https://codeburst.io/quick-n-clean-way-to-deploy-vue-webpack-apps-on-heroku-b522d3904bc8

除了我还没有完成奖金部分。当我尝试在以下位置检查我的应用程序时:

https://git.heroku.com/proto4bkchat.git https://git.heroku.com/proto4bkchat.git

我收到以下错误消息:

Method Not Allowed

通过使用本教程,我只是尝试将 dist 文件夹推送到 heroku。

在过去的几天里我尝试了很多不同的方法,不幸的是我不记得我尝试过的所有方法,我只需要帮助在heroku上部署这个应用程序。

该应用程序适用于开发和生产环境,但不适用于 heroku。

以下是我的存储库的链接:

https://gitlab.com/TitoSalay/BkChatPrototype.git https://gitlab.com/TitoSalay/BkChatPrototype.git

我之前还尝试过使用以下 server.js 文件部署整个根目录:

// server.js
const express = require('express')
const path = require('path')
const history = require('connect-history-api-fallback')

const app = express()

const staticFileMiddleware = express.static(path.join(__dirname + '/dist'))

app.use(staticFileMiddleware)
app.use(history({
  disableDotRule: true,
  verbose: true
}))
app.use(staticFileMiddleware)

app.get('/', function (req, res) {
  res.render(path.join(__dirname + '/dist/index.html'))
})

var server = app.listen(process.env.PORT || 8080, function () {
  var port = server.address().port
  console.log('App now running on port', port)
})

当我使用时:

git push heroku master

我得到以下日志:

Counting objects: 150, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (142/142), done.
Writing objects: 100% (150/150), 3.65 MiB | 544.00 KiB/s, done.
Total 150 (delta 36), 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_VERBOSE=false

remote:        NODE_ENV=production
remote:        NODE_MODULES_CACHE=true
remote:
remote: -----> Installing binaries
remote:        engines.node (package.json):  >= 6.0.0
remote:        engines.npm (package.json):   >= 3.0.0
remote:
remote:        Resolving node version >= 6.0.0...
remote:        Downloading and installing node 9.10.1...
remote:        Bootstrapping npm >= 3.0.0 (replacing 5.6.0)...
remote:        npm 5.8.0 installed
remote:
remote: -----> Restoring cache
remote:        Skipping cache restore (not-found)
remote:
remote: -----> Building dependencies
remote:        Installing node modules (package.json + package-lock)
remote:
remote:        > [email protected] /cdn-cgi/l/email-protection install /tmp/build_81bd751efdb3e588f6a9dc1ccc4e3708/node_modules/chromedriver
remote:        > node install.js

remote:        Downloading https://chromedriver.storage.googleapis.com/2.37/chromedriver_linux64.zip
remote:        Saving to /tmp/chromedriver/chromedriver_linux64.zip
remote:        Received 781K...
remote:        Received 1568K...
remote:        Received 2352K...
remote:        Received 3136K...
remote:        Received 3632K total.
remote:        Extracting zip contents
remote:        Copying to target path /tmp/build_81bd751efdb3e588f6a9dc1ccc4e3708/node_modules/chromedriver/lib/chrom
edriver
remote:        Fixing file permissions
remote:        Done. ChromeDriver binary available at /tmp/build_81bd751efdb3e588f6a9dc1ccc4e3708/node_modules/chrome
driver/lib/chromedriver/chromedriver
remote:
remote:        > [email protected] /cdn-cgi/l/email-protection postinstall /tmp/build_81bd751efdb3e588f6a9dc1ccc4e3708/node_modules/w

ebpack/node_modules/uglifyjs-webpack-plugin
remote:        > node lib/post_install.js
remote:
remote:        added 1249 packages from 969 contributors in 24.841s
remote:
remote: -----> Caching build
remote:        Clearing previous node cache
remote:        Saving 2 cacheDirectories (default):
remote:        - node_modules
remote:        - bower_components (nothing to cache)
remote:
remote: -----> Pruning devDependencies
remote:        removed 1197 packages in 12.146s
remote:
remote: -----> Build succeeded!
remote: -----> Discovering process types
remote:        Procfile declares types     -> (none)
remote:        Default types for buildpack -> web
remote:
remote: -----> Compressing...
remote:        Done: 20.9M
remote: -----> Launching...
remote:        Released v3
remote:        https://proto4bkchat.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/proto4bkchat.git
 * [new branch]      master -> master

当我使用时:

git subtree push --prefix dist heroku master

我收到以下消息:

No new revisions were found

我的程序文件:

web: node server.js

UPDATE:

我现在使用:

heroku open

我现在收到以下错误消息:

Cannot GET /

当我运行 heroku log --tail 时,我得到以下信息:

2018-04-04T14:27:59.000000+00:00 app[api]: Build started by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T14:29:00.808932+00:00 app[api]: Release v3 created by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T14:29:00.808932+00:00 app[api]: Deploy 940fed7d by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T14:29:00.827808+00:00 app[api]: Scaled to web@1:Free by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T14:27:59.000000+00:00 app[api]: Build succeeded
2018-04-04T14:29:04.680780+00:00 heroku[web.1]: Starting process with command `npm start`
2018-04-04T14:29:07.017006+00:00 app[web.1]: > [email protected] /cdn-cgi/l/email-protection start /app
2018-04-04T14:29:07.017009+00:00 app[web.1]: > node server.js
2018-04-04T14:29:07.016979+00:00 app[web.1]:
2018-04-04T14:29:07.235631+00:00 app[web.1]: App now running on port 16727
2018-04-04T14:29:07.017011+00:00 app[web.1]:
2018-04-04T14:29:08.314843+00:00 heroku[web.1]: State changed from starting to up
2018-04-04T14:29:09.911216+00:00 heroku[router]: at=info method=GET path="/" host=proto4bkchat.herokuapp.com request_
id=7e0e470c-4edd-45eb-96a1-876e1127b6f1 fwd="94.193.229.163" dyno=web.1 connect=0ms service=34ms status=404 bytes=383
 protocol=https

2018-04-04T14:29:09.902613+00:00 app[web.1]: Rewriting GET / to /index.html
2018-04-04T14:29:10.178203+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=proto4bkchat.herokuapp.c
om request_id=34efa313-9344-4e84-99f2-ce5a185c2308 fwd="94.193.229.163" dyno=web.1 connect=0ms service=3ms status=404
 bytes=394 protocol=https
2018-04-04T14:29:10.177004+00:00 app[web.1]: Rewriting GET /favicon.ico to /index.html
2018-04-04T14:33:34.284154+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=proto4bkchat.herokuapp.c
om request_id=0bc35e22-d798-4728-93a6-e3392949925b fwd="94.193.229.163" dyno=web.1 connect=0ms service=3ms status=404
 bytes=394 protocol=https
2018-04-04T14:33:34.281911+00:00 app[web.1]: Rewriting GET /favicon.ico to /index.html
2018-04-04T14:37:02.733412+00:00 app[web.1]: Rewriting GET / to /index.html
2018-04-04T14:37:02.734756+00:00 heroku[router]: at=info method=GET path="/" host=proto4bkchat.herokuapp.com request_
id=27e3f301-d6cb-484c-bc3c-108771c16da2 fwd="94.193.229.163" dyno=web.1 connect=2ms service=4ms status=404 bytes=383
protocol=https
2018-04-04T14:38:10.000000+00:00 app[api]: Build started by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T14:39:06.403176+00:00 heroku[web.1]: Restarting
2018-04-04T14:39:06.403176+00:00 heroku[web.1]: State changed from up to starting
2018-04-04T14:39:06.128567+00:00 app[api]: Deploy 9f5cc557 by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T14:39:06.128567+00:00 app[api]: Release v4 created by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T14:39:06.960489+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2018-04-04T14:39:07.062481+00:00 heroku[web.1]: Process exited with status 143
2018-04-04T14:39:09.641745+00:00 heroku[web.1]: Starting process with command `npm start`
2018-04-04T14:39:13.212697+00:00 app[web.1]:

2018-04-04T14:39:13.212716+00:00 app[web.1]: > [email protected] /cdn-cgi/l/email-protection start /app
2018-04-04T14:39:13.212718+00:00 app[web.1]: > node server.js
2018-04-04T14:39:13.212719+00:00 app[web.1]:
2018-04-04T14:39:13.816340+00:00 app[web.1]: App now running on port 55452
2018-04-04T14:39:14.207455+00:00 heroku[web.1]: State changed from starting to up
2018-04-04T14:38:10.000000+00:00 app[api]: Build succeeded
2018-04-04T14:39:38.113879+00:00 heroku[router]: at=info method=GET path="/" host=proto4bkchat.herokuapp.com request_
id=32acfc35-dd8d-4f15-9246-5c4ddb844f5f fwd="94.193.229.163" dyno=web.1 connect=1ms service=96ms status=404 bytes=383
 protocol=https
2018-04-04T14:39:38.099335+00:00 app[web.1]: Rewriting GET / to /index.html
2018-04-04T14:42:22.977451+00:00 heroku[web.1]: State changed from up to down
2018-04-04T14:42:24.124802+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2018-04-04T14:42:24.239322+00:00 heroku[web.1]: Process exited with status 143
2018-04-04T14:42:22.807668+00:00 app[api]: Rollback to v1 by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T14:42:22.807668+00:00 app[api]: Release v5 created by user [email protected] /cdn-cgi/l/email-protection

2018-04-04T20:34:52.103810+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/
" host=proto4bkchat.herokuapp.com request_id=43e0e34b-c25b-443b-8de2-69de9bada2a6 fwd="94.193.229.163" dyno= connect=
 service= status=503 bytes= protocol=https
2018-04-04T20:41:02.000000+00:00 app[api]: Build started by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T20:42:05.567081+00:00 app[api]: Release v6 created by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T20:42:05.567081+00:00 app[api]: Deploy bc9ece25 by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T20:42:07.826536+00:00 heroku[web.1]: Starting process with command `npm start`
2018-04-04T20:41:02.000000+00:00 app[api]: Build succeeded
2018-04-04T20:42:05.591139+00:00 app[api]: Scaled to web@1:Free by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T20:42:09.960096+00:00 app[web.1]:
2018-04-04T20:42:09.960114+00:00 app[web.1]: > [email protected] /cdn-cgi/l/email-protection start /app
2018-04-04T20:42:09.960117+00:00 app[web.1]: > node server.js
2018-04-04T20:42:09.960118+00:00 app[web.1]:
2018-04-04T20:42:10.309937+00:00 app[web.1]: App now running on port 46237
2018-04-04T20:42:10.526656+00:00 heroku[web.1]: State changed from starting to up
2018-04-04T20:42:13.766514+00:00 heroku[router]: at=info method=GET path="/" host=proto4bkchat.herokuapp.com request_
id=cf616fb3-2231-4ba3-b877-7fe6937a1122 fwd="94.193.229.163" dyno=web.1 connect=1ms service=63ms status=404 bytes=383
 protocol=https
2018-04-04T20:42:13.759011+00:00 app[web.1]: Rewriting GET / to /index.html
2018-04-04T20:45:37.000000+00:00 app[api]: Build started by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T20:46:34.265829+00:00 heroku[web.1]: Restarting
2018-04-04T20:46:34.268319+00:00 heroku[web.1]: State changed from up to starting
2018-04-04T20:46:33.895581+00:00 app[api]: Release v7 created by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T20:46:33.895581+00:00 app[api]: Deploy a606c93e by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T20:45:37.000000+00:00 app[api]: Build succeeded
2018-04-04T20:46:34.894801+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2018-04-04T20:46:34.969267+00:00 heroku[web.1]: Process exited with status 143
2018-04-04T20:46:36.179255+00:00 heroku[web.1]: Starting process with command `npm start`
2018-04-04T20:46:37.895380+00:00 app[web.1]:
2018-04-04T20:46:37.895400+00:00 app[web.1]: > [email protected] /cdn-cgi/l/email-protection start /app
2018-04-04T20:46:37.895402+00:00 app[web.1]:
2018-04-04T20:46:37.895401+00:00 app[web.1]: > node server.js
2018-04-04T20:46:38.111326+00:00 app[web.1]: App now running on port 24497
2018-04-04T20:46:38.504681+00:00 heroku[web.1]: State changed from starting to up
2018-04-04T20:46:42.928331+00:00 heroku[router]: at=info method=GET path="/" host=proto4bkchat.herokuapp.com request_
id=a23b2bfc-9504-412e-8c5f-2b15934a6f6c fwd="94.193.229.163" dyno=web.1 connect=0ms service=23ms status=404 bytes=383
 protocol=https

2018-04-04T20:46:42.921010+00:00 app[web.1]: Rewriting GET / to /index.html
2018-04-04T20:48:26.000000+00:00 app[api]: Build started by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T20:49:24.592773+00:00 heroku[web.1]: Restarting
2018-04-04T20:49:24.596433+00:00 heroku[web.1]: State changed from up to starting
2018-04-04T20:49:25.543655+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2018-04-04T20:49:25.647753+00:00 heroku[web.1]: Process exited with status 143
2018-04-04T20:49:26.885447+00:00 heroku[web.1]: Starting process with command `node server.js`
2018-04-04T20:48:26.000000+00:00 app[api]: Build succeeded
2018-04-04T20:49:23.562941+00:00 app[api]: Deploy 1d056fa4 by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T20:49:23.562941+00:00 app[api]: Release v8 created by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T20:49:29.013716+00:00 app[web.1]: App now running on port 48709
2018-04-04T20:49:30.529718+00:00 heroku[web.1]: State changed from starting to up
2018-04-04T20:50:06.138034+00:00 heroku[router]: at=info method=GET path="/" host=proto4bkchat.herokuapp.com request_
id=605247f4-cc6b-498f-bcd6-20b4c1c1fa6e fwd="94.193.229.163" dyno=web.1 connect=1ms service=24ms status=404 bytes=383
 protocol=https
2018-04-04T20:50:06.127297+00:00 app[web.1]: Rewriting GET / to /index.html
2018-04-04T20:54:51.000000+00:00 app[api]: Build started by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T20:55:49.316717+00:00 app[api]: Release v9 created by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T20:55:49.316717+00:00 app[api]: Deploy 346e97a0 by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T20:55:49.557030+00:00 heroku[web.1]: Restarting
2018-04-04T20:55:49.557620+00:00 heroku[web.1]: State changed from up to starting

2018-04-04T20:54:51.000000+00:00 app[api]: Build succeeded
2018-04-04T20:55:53.163175+00:00 heroku[web.1]: Starting process with command `node server.js`
2018-04-04T20:55:56.158535+00:00 app[web.1]: App now running on port 54343
2018-04-04T20:55:57.009235+00:00 heroku[web.1]: State changed from starting to up
2018-04-04T20:55:58.573480+00:00 heroku[router]: at=info method=GET path="/" host=proto4bkchat.herokuapp.com request_
id=978a1543-d080-4f10-84ca-6e7f25b3704e fwd="94.193.229.163" dyno=web.1 connect=1ms service=106ms status=404 bytes=38
3 protocol=https
2018-04-04T20:55:58.555396+00:00 app[web.1]: Rewriting GET / to /index.html
2018-04-04T20:56:09.104025+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2018-04-04T20:56:09.168587+00:00 heroku[web.1]: Process exited with status 143

该应用程序似乎根据此日志构建 dist 文件夹时出现问题:

2018-04-04T22:25:30.208992+00:00 app[api]: Initial release by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T22:25:30.208992+00:00 app[api]: Release v1 created by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T22:25:30.655267+00:00 app[api]: Release v2 created by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T22:25:30.655267+00:00 app[api]: Enable Logplex by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T22:34:17.000000+00:00 app[api]: Build started by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T22:34:17.000000+00:00 app[api]: Build failed -- check your build logs
2018-04-04T22:35:26.000000+00:00 app[api]: Build started by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T22:35:26.000000+00:00 app[api]: Build failed -- check your build logs
2018-04-04T22:36:26.000000+00:00 app[api]: Build started by user [email protected] /cdn-cgi/l/email-protection

2018-04-04T22:36:26.000000+00:00 app[api]: Build failed -- check your build logs
2018-04-04T22:39:35.000000+00:00 app[api]: Build started by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T22:39:35.000000+00:00 app[api]: Build failed -- check your build logs
2018-04-04T22:50:07.000000+00:00 app[api]: Build started by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T22:51:08.581397+00:00 app[api]: Release v3 created by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T22:50:07.000000+00:00 app[api]: Build succeeded
2018-04-04T22:51:08.581397+00:00 app[api]: Deploy 2e21be42 by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T22:51:08.606000+00:00 app[api]: Scaled to web@1:Free by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T22:51:11.160323+00:00 heroku[web.1]: Starting process with command `node server.js`
2018-04-04T22:51:13.445374+00:00 app[web.1]: App now running on port 56629
2018-04-04T22:51:15.029609+00:00 heroku[web.1]: State changed from starting to up
2018-04-04T22:53:04.169972+00:00 heroku[router]: at=info method=GET path="/" host=bkchatproto.herokuapp.com request_i
d=c554f1dc-c588-45e1-aa71-24f11bbab0f6 fwd="94.193.229.163" dyno=web.1 connect=0ms service=31ms status=404 bytes=383
protocol=http
2018-04-04T22:53:04.155705+00:00 app[web.1]: Rewriting GET / to /index.html
2018-04-04T22:53:04.429826+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=bkchatproto.herokuapp.co
m request_id=23e9f92a-3633-4ba0-b5d6-28d2a0e98ece fwd="94.193.229.163" dyno=web.1 connect=1ms service=3ms status=404
bytes=394 protocol=http
2018-04-04T22:53:04.427800+00:00 app[web.1]: Rewriting GET /favicon.ico to /index.html
2018-04-04T22:55:17.562456+00:00 heroku[router]: at=info method=GET path="/" host=proto4bkchat.herokuapp.com request_
id=7194aade-9ca5-4613-bf28-84f6d239b7d4 fwd="94.193.229.163" dyno=web.1 connect=258ms service=30ms status=404 bytes=3
83 protocol=https
bkchat_proto1/package.json12:33
LFUTF-8JSON0 files1 update

所以我在 package.json 中尝试了以下内容:

{
  "name": "bkchat_proto1",
  "version": "1.0.0",
  "description": "Bkchat website prototype",
  "author": "Christopher Salay",
  "private": true,
  "scripts": {
    "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
    "e2e": "node test/e2e/runner.js",
    "test": "npm run e2e",
    "build": "node build/build.js",
    "postinstall":"npm install && npm run build"
  },
  "dependencies": {
    "connect-history-api-fallback": "^1.5.0",
    "express": "^4.16.3",
    "serve-static": "^1.13.2",
    "vue": "^2.5.2",
    "vue-router": "^3.0.1"
  },
  "devDependencies": {
    "autoprefixer": "^7.1.2",
    "babel-core": "^6.22.1",
    "babel-helper-vue-jsx-merge-props": "^2.0.3",
    "babel-loader": "^7.1.1",
    "babel-plugin-syntax-jsx": "^6.18.0",
    "babel-plugin-transform-runtime": "^6.22.0",
    "babel-plugin-transform-vue-jsx": "^3.5.0",
    "babel-preset-env": "^1.3.2",
    "babel-preset-stage-2": "^6.22.0",
    "babel-register": "^6.22.0",
    "chalk": "^2.0.1",
    "chromedriver": "^2.27.2",
    "copy-webpack-plugin": "^4.0.1",
    "cross-spawn": "^5.0.1",
    "css-loader": "^0.28.0",
    "extract-text-webpack-plugin": "^3.0.0",
    "file-loader": "^1.1.4",
    "friendly-errors-webpack-plugin": "^1.6.1",
    "html-webpack-plugin": "^2.30.1",
    "nightwatch": "^0.9.12",
    "node-notifier": "^5.1.2",
    "optimize-css-assets-webpack-plugin": "^3.2.0",
    "ora": "^1.2.0",
    "portfinder": "^1.0.13",
    "postcss-import": "^11.0.0",
    "postcss-loader": "^2.0.8",
    "postcss-url": "^7.2.1",
    "rimraf": "^2.6.0",
    "selenium-server": "^3.0.1",
    "semver": "^5.3.0",
    "shelljs": "^0.7.6",
    "uglifyjs-webpack-plugin": "^1.1.1",
    "url-loader": "^0.5.8",
    "vue-loader": "^13.3.0",
    "vue-style-loader": "^3.0.1",
    "vue-template-compiler": "^2.5.2",
    "webpack": "^3.6.0",
    "webpack-bundle-analyzer": "^2.9.0",
    "webpack-dev-server": "^2.9.1",
    "webpack-merge": "^4.1.0"
  },
  "engines": {
    "node": ">= 6.0.0",
    "npm": ">= 3.0.0"
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not ie <= 8"
  ]
}

我正在尝试安装所有依赖项并构建 dist 文件夹,但是当我将其推送到 heroku 时,它会创建一个不断重复自身的进程,并且尽管我尝试通过 heroku cli 停止该进程,但它不会停止。 这个过程似乎也没有结束,所以我通常被迫销毁应用程序并再次创建它。

我还在我的 Procfile 中尝试了以下操作:

web: npm install
web: npm run build
web: node server.js

这次构建也失败了。


没关系,昨晚我找到了解决方案。我在 package.json 文件的脚本部分下添加了 "heroku-postinstall": "npm install && npm run build" 以使其正常工作。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

尝试将我的 vue-cli 应用程序部署到 heroku 时遇到了困难 的相关文章

  • IE从哪个版本开始支持Object.create(null)?

    您可以通过多种方式在 JavaScript 中创建对象 creates an object which makes the Object prototype of data var data1 new Object Object liter
  • 如何在react-bootstrap中禁用表单提交的

    在下面的代码片段中 我有许多文本类型的输入表单 如果用户点击 我似乎会得到相同的合成事件 就像他们按下提交按钮一样 我想忽略作为表单提交 只允许一个人按下 提交 按钮 我删除了一些表单组以减少示例 在所有情况下 按钮或 ENTER 键 e
  • 摩卡 - Chai Karma“套件未定义”

    我对 jscript tdd 很陌生 遇到了问题 希望有人能告诉我我在做什么 在浏览器中运行测试 通过 HTML 文件 一切正常 通过节点和业力运行它们我得到以下异常 我想在 node js 主机的 karma 中使用 Mocha 和 Ch
  • 图像无法在带有 DOM 的 IE 中加载:控制台中的 7009 错误(无法解码)

    当在 IE 中的单个页面上加载许多图像时 在 IE11 中重现 其中一些图像开始加载失败 并在控制台中出现类似以下警告的内容 DOM7009 无法解码 URL 处的图像 某些唯一的 url 当我查看网络流量时 似乎确实从服务器收到了每个图像
  • 如何关闭分支而不将其从 git 的历史记录中删除?

    我想提交并关闭其分支 而不将其从历史中删除 有了水银我会commit close branch then update转到上一个 然后继续工作 有了 git 我很困惑 没有与 Git 中关闭分支完全相同的方法 因为 Git 分支比 Merc
  • 使用 dc.js 按条形值对条形图中的条形进行排序(排序)

    如何通过维度的计算值而不是维度本身的名称对 dc js 示例中的 x 轴 维度 进行排序 例如 请考虑序数条形图的 dc js 示例 https github com dc js dc js blob master web examples
  • 隐藏 Div 的父级

    我只是想隐藏父divcomments section div class content content green div div div 我试过这个 document getElementById comments section pa
  • Draggable JS Bootstrap 模式 - 性能问题

    对于工作中的项目 我们在 JavaScript 中使用 Bootstrap Modal 窗口 我们想让一些窗口可移动 但我们遇到了 JQuery 的性能问题 myModal draggable handle modal header Exa
  • 有没有办法使用 Rspec/Capybara/Selenium 将 javascript console.errors 打印到终端?

    当我运行 rspec 时 是否可以让 capybara selenium 向 rspec 报告任何 javascript console errors 和其他异常 我有一大堆测试失败 但当我手动测试它时 我的应用程序正在运行 如果不知道仅在
  • 如何纠正流警告:解构(缺少注释)

    我正在编写一个小型 React Native 应用程序 并且正在尝试使用 Flow 但我无法在任何地方真正获得有关它的正确教程 我不断收到错误 destructuring Missing annotation 有关 station 这段代码
  • 在 .gitconfig 中隐藏 GitHub 令牌

    我想将所有点文件存储在 GitHub 上 包括 gitconfig 这需要我将 GitHub 令牌隐藏在 gitconfig 中 为此 我有一个 gitconfig hidden token 文件 这是我打算编辑并放在隐藏令牌的 git 下
  • 调整图像大小并将画布旋转 90 度

    这里有很多关于在 js 上使用画布旋转图像的主题 我阅读了其中的大部分内容 但无法找到解决我的问题的方法 我正在接收任何分辨率的图像 来自上传组件 我将其大小调整为 1024x768 如下所示 var canvas document cre
  • 检查 jQuery 1.7 中是否存在基于文本的选择选项

    所以我有以下 HTML 片段
  • window.location 和 location.href 之间的区别

    我对之间的区别感到困惑window location and location href 两者似乎都以相同的方式行事 有什么不同 window location是一个对象 它保存有关当前文档位置的所有信息 主机 href 端口 协议等 lo
  • 刷新页面时保存用户的选择

    我目前有一个页面显示不同团队的数据 我有一些数据 用户可以单击使其处于 打开 或 关闭 状态 并为每个数据显示不同的图标 它基本上就像一个清单 只是没有物理复选框 我想记住哪些 复选框 已被选中 即使在用户刷新页面或关闭浏览器并稍后返回之后
  • 为什么 git-svn 应该积极搜索旧历史?

    当我运行 git svn clone s 时发生了一些奇怪的事情 尽管以下信息告诉我们不要惊慌 但我想知道为什么会出现这种 svn 错误 为什么这个路径不存在 是被别人删除了吗 如果是 为什么 git svn 应该积极搜索旧历史记录 Ini
  • 如何使用 crypto-js 解密 AES ECB

    我正在尝试将加密数据从 flash 客户端 发送到服务器端的 javascript 在 asp 中作为 jscript 运行 有几个 javascript Aes 库 但它们实际上没有文档记录 我正在尝试使用 crypto js 但无法让代
  • 从 FileReader 设置背景图像样式

    我正在寻找一种解决方案 允许我从文件上传输入中获取文件并通过设置 document body style backgroundImage 来预览它 以下代码用于在 Image 元素中显示预览 function setImage id tar
  • 如何确定所有角度2分量都已渲染?

    当所有 Angular2 组件完成渲染时 是否会触发一个角度事件 For jQuery 我们可以用 function 然而 对于 Angular2 当domready事件被触发 html 只包含角度组件标签 每个组件完成渲染后 domrea
  • 如何在react-highcharts中使用图表工具提示格式化程序?

    如何使用图表工具提示格式化程序 我正在使用高图表的反应包装器 我有这样的配置 const CHART CONFIG tooltip formatter tooltip gt var s b this x b each this points

随机推荐