Skip to content

Replace all uses of vue-media-annotator alias under src/ with relative imports#1026

Merged
jjnesbitt merged 2 commits into
mainfrom
broken-import
Nov 3, 2021
Merged

Replace all uses of vue-media-annotator alias under src/ with relative imports#1026
jjnesbitt merged 2 commits into
mainfrom
broken-import

Conversation

@jjnesbitt
Copy link
Copy Markdown
Member

When using vue-media-annotator externally, attempting to import anything from src/layers/TextLayer.ts (in my case the TextData type), the following error is thrown:

1:29 Cannot find module 'vue-media-annotator/use/useStyling' or its corresponding type declarations.
  > 1 | import { TypeStyling } from 'vue-media-annotator/use/useStyling';
      |                             ^
    2 | import BaseLayer, { BaseLayerParams, LayerStyle } from './BaseLayer';
    3 | import { FrameDataTrack } from './LayerTypes';
    4 | 

I suspect this is due to the fact that in the project itself, vue-media-annotator is an alias to the src directory.
This PR just replaces that with the use of a relative path.

@subdavis
Copy link
Copy Markdown
Contributor

subdavis commented Nov 2, 2021

Can you find anywhere else "vue-media-annotator" is used inside src/ ?

There used to be something in the readme explaining this, but I guess this slipped in.

@jjnesbitt
Copy link
Copy Markdown
Member Author

Can you find anywhere else "vue-media-annotator" is used inside src/ ?

There used to be something in the readme explaining this, but I guess this slipped in.

Sure, meaning if I find anymore occurances of this, replace them with relative imports?

@subdavis
Copy link
Copy Markdown
Contributor

subdavis commented Nov 2, 2021

Yep

@jjnesbitt jjnesbitt changed the title Use relative import in src/layers/TextLayer.ts Replace all uses of vue-media-annotator alias under src/ with relative imports Nov 2, 2021
@jjnesbitt jjnesbitt requested a review from subdavis November 2, 2021 21:16
Comment thread client/src/components/TrackList.vue
Comment thread client/src/components/TypeList.vue
@waxlamp
Copy link
Copy Markdown
Member

waxlamp commented Nov 3, 2021

Can you find anywhere else "vue-media-annotator" is used inside src/ ?

There used to be something in the readme explaining this, but I guess this slipped in.

Do you mean there's a reason why we'd make vue-media-annotator an alias for src/ and that reason has been lost?

@subdavis
Copy link
Copy Markdown
Contributor

subdavis commented Nov 3, 2021

No. vue-media-annotator is used to alias this library from other packages (platform, dive-common). But the code in src/ can't use this alias itself because the alias will get bundled into the lib, and then when someone installs it from NPM, that alias points nowhere.

@jjnesbitt jjnesbitt merged commit 413fc7f into main Nov 3, 2021
@jjnesbitt jjnesbitt deleted the broken-import branch November 3, 2021 14:42
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

Successfully merging this pull request may close these issues.

3 participants