【问题标题】:Getting DLL error when trying to instal @heroicons/react in electron app尝试在电子应用程序中安装 @heroicons/react 时出现 DLL 错误
【发布时间】:2022-01-11 04:43:59
【问题描述】:

当尝试在 Electron 中使用 tailwindlab @heroicons/react 包时,我收到以下 DLL 错误:

Webpack在编译dll文件时似乎找不到包。

如何解决此错误?

【问题讨论】:

    标签: reactjs electron tailwind-css


    【解决方案1】:

    经过一些搜索和这个有类似问题的有用的github issue 之后,我最终对webpack.config.renderer.dev.dll.babel.js 进行了一个小调整(该文件参考适用于那些使用电子应用程序样板的人),这个调整是需要的renderer 入口点。

    入口点之前的值如下:

    entry: {
       renderer:{ Object.keys(dependencies || {}}
    }
    

    steveetm的建议(ish)我把它改成了:

    entry: {
       renderer: [
          ...Object.keys(dependencies || {}),
          '@heroicons/react/solid',
          '@heroicons/react/outline'
        ].filter(key => key !== '@heroicons/react')
    }
    

    我认为它不能独立工作的原因是@heroicons 在一个内有两个子包,渲染器不知道如何处理。

    【讨论】:

      猜你喜欢
      • 2022-12-16
      • 2022-06-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-24
      • 1970-01-01
      • 1970-01-01
      • 2018-02-24
      相关资源
      最近更新 更多