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

Cannot find module '../theme/icons/unlink.svg' #17358

Closed
NesTeRDGIT opened this issue Oct 30, 2024 · 6 comments
Closed

Cannot find module '../theme/icons/unlink.svg' #17358

NesTeRDGIT opened this issue Oct 30, 2024 · 6 comments
Labels
resolution:resolved This issue was already resolved (e.g. by another ticket). type:bug This issue reports a buggy (incorrect) behavior.

Comments

@NesTeRDGIT
Copy link

After updating to version 43.3.0, when building the project, we get an error:
node_modules/@ckeditor/ckeditor5-link/src/index.d.ts:21:37 - error TS2307: Cannot find module '../theme/icons/link.svg' or its corresponding type declarations.

Cause: #17304

I think need to add files *.d.ts for *.svg files or remove exporting svg as module.

@NesTeRDGIT NesTeRDGIT added the type:bug This issue reports a buggy (incorrect) behavior. label Oct 30, 2024
@Mgsy
Copy link
Member

Mgsy commented Oct 30, 2024

Hi @NesTeRDGIT! Thanks for reaching out. Could you please share more details about your project configuration and, ideally, share an example project with steps to reproduce the issue? Are you able to reproduce it with a build created by Online builder?

@NesTeRDGIT
Copy link
Author

NesTeRDGIT commented Oct 30, 2024

@Mgsy
What project details would you like to know?
Angular-18.
Typescript
dependencies {
"ckeditor5": "43.3.0",
"ckeditor5-premium-features": "43.3.0"
}

This commit commit added export SVG files as modules typescript - this is error.
Files SVG is not module.
I don't know why this was done. But you can add *.d.ts files for *.svg files, for fix TS2307 error.
Example
link.svg.d.ts:

declare const content: string;
export default content;

@Witoso
Copy link
Member

Witoso commented Oct 30, 2024

This is not reproducible on our side in a vanilla TS project: https://stackblitz.com/edit/vitejs-vite-7gibwb?file=index.html,src/style.css,src/main.ts,tsconfig.json&terminal=dev

We already export SVG icons in other places, AFAIK, there's augmentation for SVG added on our side already:

declare module '*.svg' {

Could you share minimal repro for us to take a look?

@Witoso
Copy link
Member

Witoso commented Oct 30, 2024

Thank you, we are investigating. Temporal workaround: "skipLibCheck": true, in the tsconfig.json.

@Witoso
Copy link
Member

Witoso commented Nov 6, 2024

Issue solved with 43.3.1 release.

@Witoso Witoso closed this as completed Nov 6, 2024
@Witoso Witoso added the resolution:resolved This issue was already resolved (e.g. by another ticket). label Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution:resolved This issue was already resolved (e.g. by another ticket). type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

No branches or pull requests

3 participants