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
Unable to import native module #7291
Comments
This is obviously an error thrown by Webpack. However, the My guess is NextJS is bundling using Webpack. In the Including the Webpack configuration: And there is apparently no way to customize it. |
Since Webpack will hijack any call to const { myNativeFunction } = eval('require')('/path/to/native/module'); Then the |
Thanks for this. It's a bug. We'll look into it. |
This worked for me when building a custom field using uploaded data. // run EXIF analysis
const meta = await (await import(/* webpackIgnore: true */ "./extractMeta")).extractMeta(upload.createReadStream()); |
How to reproduce
Attempt to import a module that will load a
.node
native module.Expected behavior
The app builds and runs normally.
Actual behavior
Webpack complains there is no loader for the
.node
module:I did not find how to customize Webpack in the KeystoneJS documentation.
The text was updated successfully, but these errors were encountered: