React项目抛错: Import in body of module; reorder to top import/first

itlao6 前端 开发&源码评论357字数 168阅读0分33秒阅读模式
React项目编译后,在Chrome中调试,抛出以下错误:Import in body of module; reorder to top import/first

发现代码中 import axios from "axios" 前面有一行 const常亮定义, 把import移到const前面就正常了文章源自IT老刘-https://itlao6.com/4877.html

原因:import (导入文件)必须在其它所有业务代码的前面文章源自IT老刘-https://itlao6.com/4877.html 文章源自IT老刘-https://itlao6.com/4877.html

weinxin
我的微信公众号
微信扫一扫关注公众号,不定时更新
itlao6
  • 本文由 发表于 2020年 10月 30日 16:27:22
  • 转载请务必保留本文链接:https://itlao6.com/4877.html
评论  0  访客  0
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定