pdf / renderer开玩笑ReferenceError:_a未定义

时间:2020-08-24 13:40:04

标签: javascript node.js npm node-modules pdfrenderer

我正在使用@ react-pdf / renderer软件包来生成和下载PDF。一切工作正常,除非当我使用玩笑来运行测试时,对于所有现有测试用例都抛出了错误。我尚未对PDF组件本身进行任何测试。该错误如下所示:

未为项目配置“ jest.config.js”替代。使用默认配置。

  • 测试服无法运行

参考错误:_a未定义

    > 247 |  */o.infinity=1e4,o.glue=function(e,t,n,r){return{type:"glue",value:t,width:e,stretch:n,shrink:r}},o.box.....

 at n (../abc/dist/abc.bundle.js:1:2177)
      at Module.call (../abc/dist/abc.bundle.js:272:117795)
      at n (../abc/dist/abc.bundle.js:1:2177)
      at ../abc/dist/abc.bundle.js:1:2976
      at t (../abc/dist/abc.bundle.js:1:2069)
      at ../abc/dist/abc.bundle.js:1:81
      at Object.<anonymous> (../abc/dist/abc.bundle.js:1:2)
      at Object.<anonymous> (src/redux/rootReducer.js:9:1)
      at Object.<anonymous> (src/redux/store.js:20:1)

这样的二进制文件正在控制台上为每个现有的测试文件打印。

尝试以下解决方案...

在项目根目录的.babelrc文件中添加以下内容:

"ignore": [ "node_modules/yoga-layout-prebuilt" ]

非常感谢!

0 个答案:

没有答案