【问题标题】:yarn start fails after jhipster 5.0.1 upgradejhipster 5.0.1 升级后纱线启动失败
【发布时间】:2018-06-26 19:00:28
【问题描述】:

我已经生成了一个 JHipster / React 应用程序,在将 JHipster 升级到 5.0.1(从 5.0.0-beta.1)并运行 jhipster upgrade 后,我在运行时得到以下信息 纱线开始:

WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/concepts/mode/

ERROR in multi (webpack)-dev-server/client?http://localhost:8081 ./src
Module not found: Error: Can't resolve './src' in '/Users/yvon/git/ods-jhipster-sns'
 @ multi (webpack)-dev-server/client?http://localhost:8081 ./src
ℹ 「wdm」: Failed to compile.

我尝试使用 5.0.1 生成器生成分支新 jhipster 应用程序,但 yarn start 在完全相同的位置失败。

这是 package.json 的相关部分:

  "scripts": {
"precommit": "lint-staged",
"prettier:format": "yarn prettier --write 'src/**/*.{ts,tsx,css,scss}'",
"lint": "tslint --project tsconfig.json -e 'node_modules/**'",
"lint:fix": "yarn run lint --fix",
"cleanup": "rimraf target/www",
"start": "yarn run webpack:dev",
"test": "yarn run lint && jest --coverage --logHeapUsage -w=2 --config src/test/javascript/jest.conf.js",
"test:watch": "yarn test --watch",
"webpack:dev": "yarn run webpack-dev-server --config webpack/webpack.dev.js --progress --inline --profile --port=9060",
"webpack:build:main": "yarn run webpack --config webpack/webpack.dev.js --progress --profile",
"webpack:build": "yarn run cleanup && yarn run webpack:build:main",
"webpack:prod:main": "yarn run webpack --config webpack/webpack.prod.js --profile",
"webpack:prod": "yarn run cleanup && yarn run webpack:prod:main",
"webpack:test": "yarn run test",
"webpack-dev-server": "node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js",
"webpack": "node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js"},

webpack-dev.js

const webpack = require('webpack');
const writeFilePlugin = require('write-file-webpack-plugin');
const webpackMerge = require('webpack-merge');
const BrowserSyncPlugin = require('browser-sync-webpack-plugin');
const WebpackNotifierPlugin = require('webpack-notifier');
const path = require('path');

const utils = require('./utils.js');
const commonConfig = require('./webpack.common.js');

const ENV = 'development';

module.exports = webpackMerge(commonConfig({ env: ENV }), {
  devtool: 'cheap-module-source-map', // https://reactjs.org/docs/cross-origin-errors.html
  mode: 'development',
  entry: [
    'react-hot-loader/patch',
    './src/main/webapp/app/index'
  ],

是 JHipster/React 5.0.1 坏了,还是我遗漏了一些明显的东西?

【问题讨论】:

    标签: webpack jhipster webpack-dev-server


    【解决方案1】:

    我遇到了同样的问题。使用 jhipster info 命令发现 yarn 的版本太旧了。我升级到 1.7 版。现在 Webpack 服务器正在运行。

    【讨论】:

    • ℹ「wdm」:编译成功。未找到类型错误未找到 lint 错误版本:typescript 2.8.1,tslint 5.9.1 时间:6343ms [Browsersync] 代理:localhost:9060 [Browsersync] 访问 URL:
    • 哇,如果 stackoverflow 有“向此人发送现金提示”选项,我现在会向您发送现金提示。谢谢,就是这样!
    猜你喜欢
    • 1970-01-01
    • 2019-03-07
    • 1970-01-01
    • 2018-08-28
    • 2018-03-01
    • 2017-03-16
    • 2023-04-01
    • 1970-01-01
    • 2019-08-03
    相关资源
    最近更新 更多