You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When embedding the solc library into my current Directus project, I encountered an issue with the module type, as shown in the image below.
This error does not display any warning messages, but it affects the entire file and causes an issue right from the moment the library is imported.
I also tried some other external libraries besides solc and faced similar issues.
Fix
I fixed this issue by adding a file index.d.ts directly into node_modules of solc, copying the content from index.js.
It looks like this:
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; const wrapper_1 = __importDefault(require("./wrapper")); const soljson = require('./soljson.js'); module.exports = (0, wrapper_1.default)(soljson);
I don't understand why this happens, so any explanation would be highly appreciated!
Alternatively, if there is a better approach or if an official patch is needed for this issue, I would love to know.
Since I cannot update the library directly on the server, I need a feasible solution.
Thank you very much!!!
The text was updated successfully, but these errors were encountered:
#693 should address this. The core issue is that solc-js currently doesn't export types. We do plan to add type exports eventually, but there are other priorities at the moment. So while that PR may resolve your issue, some additional work will still be needed to fully support it.
Use:
Error:
solc
library into my current Directus project, I encountered an issue with the module type, as shown in the image below.solc
and faced similar issues.Fix
node_modules
ofsolc
, copying the content fromindex.js
."use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; const wrapper_1 = __importDefault(require("./wrapper")); const soljson = require('./soljson.js'); module.exports = (0, wrapper_1.default)(soljson);
Alternatively, if there is a better approach or if an official patch is needed for this issue, I would love to know.
Since I cannot update the library directly on the server, I need a feasible solution.
Thank you very much!!!
The text was updated successfully, but these errors were encountered: