Skip to content

SOLC error type in Directus Extension #766

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

Open
quynhXEM opened this issue Mar 18, 2025 · 1 comment
Open

SOLC error type in Directus Extension #766

quynhXEM opened this issue Mar 18, 2025 · 1 comment

Comments

@quynhXEM
Copy link

quynhXEM commented Mar 18, 2025

Use:

  • Directus Extension 11.5.1
  • SOLC 0.8.29

Error:

  • 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.
    Image

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);
Image

  • 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!!!

@r0qs
Copy link
Member

r0qs commented Mar 21, 2025

#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants