6
supposed to support module loading 인 import
인 Chrome 61을 실행 중입니다.크롬 61 : 예기치 않은 토큰 가져 오기
실제로 Paul의 demo은 저에게 효과적입니다. 그러나 직접 시도 할 때 JS 오류 "예기치 않은 토큰 가져 오기"가 발생합니다. 크롬은 import
망설 것 같습니다 :
test.html를
<!doctype html>
<html>
<body>
<script src="test.js"></script>
</body>
</html>
test.js :
import {hello} from './something.js'
console.log(hello())
something.js이
export {hello}
function hello() {
return "hello world"
}
왜 크롬은 "수입"을 이해하지 않습니다
이 코드는 type = module을 사용할 때 유용합니다. 그럼에도 불구하고 Chrome 개발자 도구는 파일을 편집 할 때 test.js에서 "Uncaught Syntax 오류 : 예기치 않은 토큰 {"오류를 표시합니다. 어떤 생각을 어떻게 극복 할 수 있을까요? – Stefan
@Stefan Chrome v64 개발자 도구 디버거는 여전히 가져 오기 및 내보내기에 문제가 있습니다. – Optimax