Skip to content

Something wrong with generated types 0.1.3 #5

@andrewheumann

Description

@andrewheumann

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions