Electron-react-boilerplate: Another "ERROR in dll renderer" issue

Created on 16 Apr 2020  路  3Comments  路  Source: electron-react-boilerplate/electron-react-boilerplate

I see the issue "ERROR in dll renderer" when installing a package via yarn; solutions in past issues aren't complete or don't work for me.

Prerequisites

  • [x] Using yarn
  • [x] Using node 10.x
  • [x] Using an up-to-date master branch
  • [x] Using latest version of devtools. See wiki for howto update
  • [ ] Link to stacktrace in a Gist (for bugs)
  • [ ] For issue in production release, devtools output of DEBUG_PROD=true yarn build && yarn start
  • [x] Tried solutions mentioned in #400

Expected Behavior


Current Behavior


Possible Solution


Steps to Reproduce (for bugs)


  1. From readme: git clone --depth 1 --single-branch https://github.com/electron-react-boilerplate/electron-react-boilerplate.git your-project-name then cd your-project-name then yarn

  2. yarn add secure-remote-password

Error appears -

ERROR in dll renderer
Module not found: Error: Can't resolve 'secure-remote-password' in '---path---/your-project-name'
 @ dll renderer renderer[21]

Context

Just trying to install the module secure-remote-password :)
Removing node_modules does not work (issue here)

Your Environment

  • Node version : 13.11.0
  • Version or Branch used : master
  • Operating System and version : Catalina 10.15.2
  • Link to your project :
bug

Most helpful comment

This can also happen if you accidentally put any @types/ packages in your dependencies in package.json instead of devDependencies. Ugh.

All 3 comments

This is due how secure-remote-password created as a node module and how the renderer build tries to assemble the bundle.
The problem is, that webpack is right here, you can't really resolve secure-remote-password, because there is no such thing. Just try to require it in plain node repl. Even the docs suggests you should require either secure-remote-password/server or /client. This makes sense as package.json of that package contains no main field, so you can't know what to resolve when someone request the package itself.

If you go to webbpack.config.renderer.dev.dll.babel.js find entry and try this:

  entry: {
    renderer: [
      ...Object.keys(dependencies || {}),
      'secure-remote-password/client'
    ].filter(key => key !== 'secure-remote-password')
  },

As by default we try to put every package from the root package.json into the renderer's dll bundle. But that is impossible for packages without main field, so we filter out this one, and add a resolvable module.

Please note this is an ugly workaround, not sure how to solve this properly.
We should either preparse dependency key of package.json and filter out mainless packages and show a proper warning or have an other key where you could override such packages how to import them by webpack bundler.

This worked - thanks for replying! Will update if I end up making any of the other changes to fix this dependency issue.

This can also happen if you accidentally put any @types/ packages in your dependencies in package.json instead of devDependencies. Ugh.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SirWindfield picture SirWindfield  路  3Comments

juangl picture juangl  路  4Comments

10SPD picture 10SPD  路  3Comments

ceemion picture ceemion  路  3Comments

kennetpostigo picture kennetpostigo  路  3Comments