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

Something wrong with generated types 0.1.3 #5

Open
andrewheumann opened this issue Apr 5, 2023 · 1 comment
Open

Something wrong with generated types 0.1.3 #5

andrewheumann opened this issue Apr 5, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@andrewheumann
Copy link

Describe the bug
My typescript project won't build with 0.1.3 of y-utility installed. It complains:

Cannot find module './node_modules/yjs/dist/src/internals.js' or its corresponding type declarations.

The generated y-multidoc-undomanager.d.ts in dist in 0.1.2 looks like this:

export class YMultiDocUndoManager extends Observable<any> {
   ...
   _defaultOpts: UndoManagerOptions;

and the one in 0.1.3 looks like this:

export class YMultiDocUndoManager extends Observable<any> {
  ...
   _defaultOpts: import("./node_modules/yjs/dist/src/internals.js").UndoManagerOptions;
    

And that funny .node_modules path seems to be the cause of the error.

It seems like this may be related to the typescript 5 upgrade / cca9c82? If I change moduleResolution back from nodenext to node, the type of _defaultOpts looks like this:

    _defaultOpts: import("yjs/dist/src/internals").UndoManagerOptions;

which at least doesn't give me any lint errors.

It's also possible that the new type output is valid and just incompatible with my specific project. We are using node 14 and typescript 4, if that matters.

@andrewheumann andrewheumann added the bug Something isn't working label Apr 5, 2023
@andrewheumann
Copy link
Author

Just checking in on this... we've had to build against our own fork of the project for a month now to get around this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants