Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
591 views
in Technique[技术] by (71.8m points)

webpack 编译iconfont svg是报错了

ERROR in ./src/component/Nav.js
Module build failed: SyntaxError: Namespace tags are not supported. ReactJSX is not XML.

  13 |                         <Link>
  14 |                             <svg className="icon" aria-hidden="true">
> 15 |                                  <use xlink:href="#icon-4"></use>
     |                                       ^
  16 |                             </svg>
  17 |                             <span>发现音乐</span>
  18 |                         </Link>

 @ ./src/component/routes.js 13:11-27```

然后我用了font-class引用 但是显示的是个小方框 怎么解

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

.. xlink:href -> xlinkHref 方便后来人吧


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...