//test_1.html
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="utf-8" />
<title>DB Test</title>
</head>
<body>
<script type="module">
var num = 1;
console.log(num)
export {num}
</script>
</body>
</html>
//test_2.html
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="utf-8" />
<title>DB Test</title>
</head>
<body>
<script type="module">
import {num} from './test_1.html'
console.log(num)
</script>
</body>
</html>
I want to use variable named num in test_1.html and test_2.html, but when I open test_2.html, error like 'test_1.html:1
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.' occurs and console.log(num) at test_2.html doesn't work properly. How can I import/export properly?