-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webpack does not work with native dependencies. #3569
Comments
does your module use in renderer or main? native dependencies works with main process. |
I am using it in the renderer |
Yes, its an UI Library thats why I am confused on the error. |
Hi, I encountered a similar issue where a native package wasn't working as expected(other package. not yours). To resolve this, I installed the native-addon-loader package as a devDependency in the root package.json and modified the webpack files. Below is the relevant code: // webpack.config.main.prod.ts
// and
// webpack.config.renderer.dev.ts
{
...
module: {
...
rules: [
{
test: /\.node$/,
use: 'native-addon-loader',
},
],
},
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json', '.node'],
},
} By adding this configuration to both I hope this experience proves helpful. |
Webpack does not work with native dependencies.
flowbite-react is a native dependency and should be installed inside of the "./release/app" folder.
First, uninstall the packages from "./package.json":
npm uninstall your-package
Then, instead of installing the package to the root "./package.json":
npm install your-package
Install the package to "./release/app/package.json"
cd ./release/app && npm install your-package
Read more about native dependencies at:
https://electron-react-boilerplate.js.org/docs/adding-dependencies/#module-structure
The text was updated successfully, but these errors were encountered: