【发布时间】:2018-11-21 02:33:23
【问题描述】:
获取堆栈跟踪
SyntaxError: The string did not match the expected pattern.
at XMLHttpRequest.open (node_modules/jsdom/lib/jsdom/living/xmlhttprequest.js:482:15)
at http (node_modules/httpplease/lib/index.js:106:9)
at Function.get (node_modules/httpplease/lib/index.js:139:16)
at InlineSVG.getFile (node_modules/react-inlinesvg/lib/index.js:151:14)
at InlineSVG.load (node_modules/react-inlinesvg/lib/index.js:193:19)
at callCallback (node_modules/react-dom/cjs/react-dom.development.js:10764:12)
at commitUpdateQueue (node_modules/react-dom/cjs/react-dom.development.js:10797:7)
at commitLifeCycles (node_modules/react-dom/cjs/react-dom.development.js:14264:11)
at commitAllLifeCycles (node_modules/react-dom/cjs/react-dom.development.js:15342:7)
at HTMLUnknownElement.callCallback (node_modules/react-dom/cjs/react-dom.development.js:100:14)
渲染 SVG 图标时。我的 mock 在 package.json 中配置为 "\\.(svg|ttf|jpg)$": "<rootDir>/src/__mocks__/fileMock.js", andfileMock.js 的内容是:
module.exports = 'test-file-mock';
`
【问题讨论】:
标签: javascript reactjs webpack jestjs