saltyshiomix / nextron

⚡ Next.js + Electron ⚡
https://npm.im/nextron
MIT License
3.97k stars 229 forks source link

Error: Cannot find module 'conf' when running in production #348

Closed fyfirman closed 1 year ago

fyfirman commented 1 year ago

Hello,

I'm encountering an error when running my production app, but I haven't made any intentional changes to the code. It works fine in development mode, though. The only changes I've made were to fix a different error that I encountered earlier.

image

Text version ``` Uncaught Exception: Error: Cannot find module 'conf' Require stack: - /Applications/My Nextron App.app/Contents/Resources/app.asar/node_modules/electron-store/index.js - /Applications/My Nextron App.app/Contents/Resources/app.asar/app/background.js - at Module._resolveFilename (node:internal/modules/cjs/loader:940:15) at n._resolveFilename (node:electron/js2c/browser_init:249:1105) at Module._load (node:internal/modules/cjs/loader:785:27) at c._load (node:electron/js2c/asar_bundle:5:13343) at Module.require (node:internal/modules/cjs/loader:1012:19) at require (node:internal/modules/cjs/helpers:102:18) at Object. (/Applications/My Nextron App.app/Contents/Resources/app.asar/node_modules/electron-store/index.js:4:14) at Module._compile (node:internal/modules/cjs/loader:1120:14) at Module._extensions..js (node:internal/modules/cjs/loader:1175:10) at Module.load (node:internal/modules/cjs/loader:988:32) ```

Here are the steps to reproduce the issue:

  1. Create a project with the emotion library.
    pnpx create-nextron-app my-app --example with-emotion
  2. Install @babel/runtime-corejs3 as a development dependency.
  3. Build the application using pnpm build.
  4. Install and run the app.

Is there anyone who can help me with this error?

Device: Macbook M1 Pro
OS: macOS Ventura 13.3.1
Node version: v16.15.1
electron-builder  version=23.6.0 os=22.4.0

Thank you, and let me know if you need any additional information from me.

fyfirman commented 1 year ago

I found the solution guys. It turns out that I used pnpm 6.32.12, changing to yarn or npm and it works.