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

Does it support Typescript 5.X features? #526

Closed
steschi opened this issue Jul 27, 2023 · 3 comments
Closed

Does it support Typescript 5.X features? #526

steschi opened this issue Jul 27, 2023 · 3 comments
Assignees

Comments

@steschi
Copy link

steschi commented Jul 27, 2023

Hey all!

Currently evaluating mobx-keystone for a project. We are already using typescript 5.1.6 and the "new" decorators as well as "moduleResolution": "bundler" in tsconfig.json but this yields some issues when importing mobx-keystone. Should this work already? Or is mobx-keystone not ready for this yet?

TS7016: Could not find a declaration file for module mobx-keystone:
./node_modules/mobx-keystone/dist/mobx-keystone.esm.mjs implicitly has an  any  type.

There are types at ./node_modules/mobx-keystone/dist/types/index.d.ts, 
but this result could not be resolved when respecting package.json exports. 
The mobx-keystone library may need to update its package.json or typings.

I think "types": "./dist/types/index.d.ts" is missing in the exports tag of package.json. If I add it manually the resolve works as expected.

"exports": {
    "./package.json": "./package.json",
    ".": {
      "import": "./dist/mobx-keystone.esm.mjs",
      "require": "./dist/mobx-keystone.umd.js",
      "script": "./dist/mobx-keystone.umd.js",
      "default": "./dist/mobx-keystone.esm.mjs",
      "types": "./dist/types/index.d.ts"
    }
  }
@xaviergonz
Copy link
Owner

The module resolution issue seems to be a bug. I'll release a new version to fix it.

About the new decorators, the lib depends on mobx so mobx itself needs to support the new decorators before any work can be done on this side 😢

@xaviergonz
Copy link
Owner

I think the bundler part should be fixed now in 1.6.4

@xaviergonz xaviergonz self-assigned this Jul 27, 2023
@steschi
Copy link
Author

steschi commented Jul 28, 2023

Thanks for solving this so quickly. 1.6.4 works for me now. It looks like the new decorators are at least considered by mobx so im looking forward to it.

@steschi steschi closed this as completed Jul 28, 2023
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