Skip to content

Native modules not working in production in mac #756

Open
@pradhansagar

Description

@pradhansagar

Describe the bug

I am using electron-vite for my electron app, and I am using some appium related native libraries like appium-adb, appium-ios-device etc. Its working fine in the development when i use them them either using dynamic import (for ES module). But in production the module gives error with not able to find its sub dependencies. I have mentioned the libraries in Rollupoptions external and also added to asarunpack with node_modules path to the libraries. This is working fine in windows / linux. But issue is coming in mac OS. Below is the error

"code": "MODULE_NOT_FOUND",
"requireStack": [
"/Applications/app/Contents/Resources/app.asar/node_modules/zip-stream/index.js",
"/Applications/app/Contents/Resources/app.asar/node_modules/archiver/lib/plugins/zip.js",
"/Applications/app/Contents/Resources/app.asar/node_modules/archiver/index.js",
"/Applications/app/Contents/Resources/app.asar/node_modules/@appium/support/build/lib/zip.js",
"/Applications/app/Contents/Resources/app.asar/node_modules/@appium/support/build/lib/index.js",
"/Applications/app/Contents/Resources/app.asar/node_modules/@appium/support/index.js",
"/Applications/app/Contents/Resources/app.asar/node_modules/appium-adb/build/lib/helpers.js",
"/Applications/app/Contents/Resources/app.asar/node_modules/appium-adb/build/lib/adb.js"
]
}

Electron-Vite Version

2.3.0

Electron Version

34

Vite Version

5.3.1

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions