Skip to content
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

Could not find a declaration file. #12

Open
rajbirjohar opened this issue Mar 27, 2024 · 1 comment
Open

Could not find a declaration file. #12

rajbirjohar opened this issue Mar 27, 2024 · 1 comment

Comments

@rajbirjohar
Copy link

rajbirjohar commented Mar 27, 2024

Describe the bug
Received this error when trying to import DxfParser.

Could not find a declaration file for module 'dxf-json'. '/Users/rajbirjohar/Projects/oxygen/oxygen-ui/node_modules/.pnpm/[email protected]/node_modules/dxf-json/dist/bundle.mjs' implicitly has an 'any' type.
  There are types at '/Users/rajbirjohar/Projects/oxygen/oxygen-ui/node_modules/dxf-json/dist/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'dxf-json' library may need to update its package.json or typings.

Seems like the types are not being created correctly.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new react project.
  2. Install dxf-json.
  3. Import DxfParser.

Expected behavior
The types should be resolved correctly.

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: FF Dev Edition

Additional context
On a side note, would this help me render the json as a threeJS object?

Edit: Workaround found:

Add this to your tsconfig

 "paths": {
      "@/*": ["./src/*"],
      "dxf-json": ["./node_modules/dxf-json/dist/index.d.ts"]
    }
@dotoritos-kim
Copy link
Owner

Since this issue is so extensive, all I can say is to try various things.

On a side note, would this help me render the json as a threeJS object? ->
Although it does not provide direct help to three.js, it can at least help process data easily by converting it to json. And it feels compatible with that repository.

https://github.com/vagran/dxf-viewer

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