【发布时间】:2021-03-16 12:26:45
【问题描述】:
我正在尝试在 html 文件的 js 代码中使用 errLogin 模块。
这是 main.js 文件。
import puppeteer from "puppeteer"
const errLogin = false;
...
export default { errLogin }
这是 test.html 文件。
<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8">
<title>main</title>
<style>
body {
font-family: Consolas, monospace;
}
</style>
<script src="./account.js"></script>
<script type="module">
import { errLogin } from "./main.js"
console.log(errLogin)
</script>
</head>
<body>
<div>
<p id="email"></p>
<p id="password"></p>
</div>
<script>
const CirculateData = () =>{
for (let key in account)
{
if (!errLogin) return account[key];
else return account[Number(key) + 1];
}
};
document.querySelector("#email").innerHTML = CirculateData().email
document.querySelector("#password").innerHTML = CirculateData().password
</script>
</body>
</html>
错误信息。
Uncaught TypeError: Failed to resolve module specifier "puppeteer". Relative references must start with either "/", "./", or "../".
这是文件夹结构。
我该怎么做?我该怎么做?我该怎么做?我该怎么做?我该怎么做?我该怎么做?我该怎么做?我该怎么做?我该怎么做?我该怎么做?
【问题讨论】:
-
什么是文件夹结构?你能告诉我文件夹结构吗
-
添加了!请确认。
标签: javascript html puppeteer script