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

TS error: Property 'index' comes from an index signature #2

Open
RaminGe opened this issue Jul 21, 2023 · 2 comments
Open

TS error: Property 'index' comes from an index signature #2

RaminGe opened this issue Jul 21, 2023 · 2 comments

Comments

@RaminGe
Copy link

RaminGe commented Jul 21, 2023

Hey there,

thanks for this simple and easy to use image viewer! I found one issue with the package added to my Angular 16 project which is the following error message:

Error: node_modules/awesome-image-viewer/src/imageViewer.ts:265:43 - error TS4111: Property 'index' comes from an index signature, so it must be accessed with ['index'].

265                 const index = tar.dataset.index;
                                              ~~~~~


Error: node_modules/awesome-image-viewer/src/imageViewer.ts:290:44 - error TS4111: Property 'url' comes from an index signature, so it must be accessed with ['url'].

290         const url = imageContainer.dataset.url;
                                               ~~~

The workaround right now is to just edit the tsconfig.json:

"compilerOptions": {
  "noPropertyAccessFromIndexSignature": false,
}

However, would be nice to change replace those lines.

@MostafaMDZH
Copy link
Owner

Hi @RaminGe
Happy to see it's useful for you, I'll check the error soon.
Thanks for your feedback. ✌✌✌

@RaminGe
Copy link
Author

RaminGe commented Aug 8, 2023

@MostafaMDZH I have created a small PR to address this issue :) Might look into #3 if I have time

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