gpt4 book ai didi

windows - Windows 机器上的盲目定位异常

转载 作者:行者123 更新时间:2023-12-02 02:40:30 25 4
gpt4 key购买 nike

在本地部署我们的 Vaadin 14 Java 应用程序时,webpack 在 Windows 机器上完成时大部分时间都会抛出错误。在 Mac 和 Linux 机器上,它工作得很好。这是我在启动时遇到的错误:

[ERROR][webpack][dev-webpack] ERROR in ./styles/vaadin/vaadin-context-menu-list-box.scss
[ERROR][webpack][dev-webpack] Module not found: Error: Encountered unexpected blind targeting request for C:\Users\efranke\Projekte\Java\Tracy\tracy-web\node_modules\babel-loader\lib\index.js??ref--4-0!C:\Users\efranke\Projekte\Java\Tracy\tracy-web\node_modules\babel-loader\lib\index.js??ref--6!C:\Users\efranke\Projekte\Java\Tracy\tracy-web\node_modules\css-loader\dist\runtime\api.js.Please see http://github.com/DanielSchaffer/webpack-babel-multi-target-plugin#blind-targeting for more information.
[ERROR][webpack][dev-webpack] @ ./styles/vaadin/vaadin-context-menu-list-box.scss 1:27-90
[ERROR][webpack][dev-webpack] @ ../target/frontend/generated-flow-imports.js
[ERROR][webpack][dev-webpack] i ?wdm?: Failed to compile.
[ERROR][webpack][dev-webpack]
------------------ Frontend compilation failed. -----------------

如果我们在 Mac 或 Linux 机器上执行此操作,它在 100% 的时间内运行良好。

Webpack 配置:

const merge = require('webpack-merge');
const flowDefaults = require('./webpack.generated.js');

module.exports = merge(flowDefaults, {
module: {
rules: [
{
test: /\.js$/,
use: {
loader: 'babel-loader',
options: {
plugins: [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-syntax-dynamic-import',
['@babel/plugin-proposal-decorators',
{decoratorsBeforeExport: true}],
]
}
}
},
{
test: /\.lcss$/, //match any lit css files (.lcss)
use: [{
loader: 'lit-scss-loader',
options: {
minify: true, // defaults to false

},
}, 'extract-loader', 'css-loader', 'sass-loader'],
},
{
test: /\.s[ac]ss$/i,
use: [
'css-loader',
'sass-loader',
],
}
]
}
});

包.json

{
"name": "no-name",
"description": "Inhouse reporting as a service tool",
"version": "14.0.5",
"license": "UNLICENSED",
"repository": {
"type": "git",
"url": "https://gitlab.bonprix.work/vt-ec-cp-mdp/tracy.git"
},
"dependencies": {
"@polymer/iron-icons": "^3.0.1",
"@polymer/polymer": "3.2.0",
"@vaadin/flow-deps": "./target/frontend",
"@webcomponents/webcomponentsjs": "^2.2.10",
"bootstrap-webcomponents": "^4.3.0",
"bower": "^1.8.8",
"file-loader": "^4.2.0",
"lit-element": "^2.2.1",
"mini-css-extract-plugin": "^0.8.0",
"polymer-modulizer": "^0.4.3",
"style-loader": "^1.0.0"
},
"devDependencies": {
"@babel/plugin-proposal-class-properties": "^7.5.5",
"@babel/plugin-proposal-decorators": "^7.4.4",
"@webcomponents/webcomponentsjs": "^2.2.10",
"awesome-typescript-loader": "5.2.1",
"compression-webpack-plugin": "3.0.0",
"copy-webpack-plugin": "5.0.3",
"css-loader": "^3.2.0",
"extract-loader": "^3.1.0",
"html-webpack-plugin": "3.2.0",
"lit-scss-loader": "^1.0.0",
"node-sass": "^4.12.0",
"raw-loader": "3.0.0",
"sass-loader": "^7.3.1",
"script-ext-html-webpack-plugin": "2.1.4",
"typescript": "3.5.3",
"webpack": "4.30.0",
"webpack-babel-multi-target-plugin": "2.1.0",
"webpack-cli": "3.3.0",
"webpack-dev-server": "3.3.0",
"webpack-merge": "4.2.1"
},
"vaadinAppPackageHash": "8c2fd8a52a1f047cb3d5fe048da8b8fc57e3c5626c86edad9032171f7a75a2c1",
"vaadin": {
"disableUsageStatistics": true
}
}

我已经尝试手动重新加载所有必需的依赖项,如所述 here , 使缓存无效 (npm cache clean --force) 并删除 node_modules 文件夹。因为它没有解决问题,而且它在 Mac 和 Linux 机器上运行良好这一事实让我假设这是一个特定于 Windows 的问题。

最佳答案

Vaadin 版本从 14.0.12 升级到 14.1.5 解决了这个问题。在此版本中,Vaadin 使用更新的依赖项,即“webpack-babel-multi-target-plugin”。手动更新此版本没有帮助。感谢 Tatu Lund 找到解决方案。

关于windows - Windows 机器上的盲目定位异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59855132/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com