We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f944375 commit 7b0b083Copy full SHA for 7b0b083
packages/core/src/plugins/nodeAddons.ts
@@ -26,10 +26,12 @@ export const pluginNodeAddons = (): RsbuildPlugin => ({
26
27
return `
28
try {
29
-const path = require("node:path");
30
-process.dlopen(module, path.join(__dirname, "${name}"));
+ const path = require("node:path");
+ process.dlopen(module, path.join(__dirname, "${name}"));
31
} catch (error) {
32
-throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
+ throw new Error('Failed to load Node.js addon: "${name}"', {
33
+ cause: error,
34
+ });
35
}
36
`;
37
},
0 commit comments