gpt4 book ai didi

javascript - React JS min 脚本链接不起作用

转载 作者:行者123 更新时间:2023-11-29 17:48:06 25 4
gpt4 key购买 nike

使用IntelliJ Idea并创建一个index.htm文件

我只是想包含以下链接并在服务器端运行代码
屏幕上没有呈现任何内容:

<html >
<head>
<script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>

<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>

<title>Live Link</title>
</head>
<body>

<div id="Output"></div>

<script type="text/babel">
ReactDOM.render(<h1>Hello Human</h1>, window.document.getElementById('Output'));
</script>
</body>
</html>

此旧版本链接有效,但新版本链接无效。

https://stackoverflow.com/a/33963992/5078763

Getting below Error in Console.log:

    babel.min.js:5 Uncaught SyntaxError: Invalid regular expression: Range out of order in character class
at new RegExp (<anonymous>)
at Object.<anonymous> (babel.min.js:5)
at t (babel.min.js:1)
at Object.t.__esModule (babel.min.js:19)
at t (babel.min.js:1)
at Object.<anonymous> (babel.min.js:2)
at t (babel.min.js:1)
at Object.e.exports (babel.min.js:1)
at t (babel.min.js:1)
at Object.e.exports.version (babel.min.js:1)
(anonymous) @ babel.min.js:5
t @ babel.min.js:1
t.__esModule @ babel.min.js:19
t @ babel.min.js:1
(anonymous) @ babel.min.js:2
t @ babel.min.js:1
e.exports @ babel.min.js:1
t @ babel.min.js:1
e.exports.version @ babel.min.js:1
t @ babel.min.js:1
t.__esModule @ babel.min.js:16
t @ babel.min.js:1
t.__esModule @ babel.min.js:11
t @ babel.min.js:1
(anonymous) @ babel.min.js:2
t.__esModule @ babel.min.js:2
t @ babel.min.js:1
t.__esModule @ babel.min.js:10
t @ babel.min.js:1
t.__esModule @ babel.min.js:14
t @ babel.min.js:1
t.__esModule @ babel.min.js:1
t @ babel.min.js:1
(anonymous) @ babel.min.js:1
(anonymous) @ babel.min.js:1
(anonymous) @ babel.min.js:1
(anonymous) @ babel.min.js:1
raven.min.js:2 <img>​

最佳答案

缩小的babel.min.js包含 utf-8 编码的字符串。您可以通过输入 <meta charset="utf-8"> 来使您的示例正常工作。在你的<head>里面.

关于javascript - React JS min 脚本链接不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47085634/

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