我正在Visual Studio 2015中创建一个C ++库。该项目显然不应该“成功”构建。 例如,如果我在源文件中键入garbage,它就会构建。 我希望在没有覆盖纯虚函数时收到警告,但我根本得不到任何反馈。 这是一段视频,展示了究竟发生了什么: https : //www.you ...
提示:本站收集StackOverFlow近2千万问答,支持中英文搜索,鼠标放在语句上弹窗显示对应的参考中文或英文, 本站还提供 中文繁体 英文版本 中英对照 版本,有任何建议请联系yoyou2525@163.com。
我有一个正在使用webpack-dev-server开发的create-react-app React应用程序,并且一切都在开发中正常工作。
但是,当我为生产而构建时,输出构建不起作用,并且出现以下控制台错误:
Uncaught SyntaxError: Unexpected token < :4001/static/js/1.33f1f515.chunk.js/:1
Uncaught SyntaxError: Unexpected token < :4001/static/js/main.625fef55.chunk.js/:1
Uncaught SyntaxError: Unexpected token < manifest.json:1 Manifest: Line: 1, column: 1, Unexpected token.
您是否在生产环境中使用Express(nodejs)服务器?
如果是,则检查静态文件服务配置。 问题是/manifest.json
, /static/js/main.625fef55.chunk.js/
等是index.html返回,而不是清单或JS文件。
这是我的示例服务器文件-
const express = require('express');
const path = require('path');
const app = express();
app.use('/', express.static(path.join(__dirname, '../build')));
app.use(function(req, res, next) {
//console.log(req.originalUrl);
next();
});
// to check if server is running
app.get('/ping', (req, res) => {
res.json({
success: true,
message: 'pong'
})
});
app.get('/*', function(req, res) {
res.sendFile(path.join(__dirname, '../build', 'index.html'));
});
module.exports = app;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.