Skip to content

Typescript 6 support (side-effect compilation errors) #3030

Closed

Description

@anisabboud

When trying the latest version of mathlive (0.109.2) with Typescript 6, I'm getting compilation errors in mathlive/types/mathlive-ssr.d.ts:

Image
✘ [ERROR] TS2882: Cannot find module or type declarations for side-effect import of '../core/math-environment'. [plugin angular-compiler]

    node_modules/mathlive/types/mathlive-ssr.d.ts:9:7:
      9 │ import '../core/math-environment';
        ╵        ~~~~~~~~~~~~~~~~~~~~~~~~~~


✘ [ERROR] TS2882: Cannot find module or type declarations for side-effect import of '../latex-commands/definitions'. [plugin angular-compiler]

    node_modules/mathlive/types/mathlive-ssr.d.ts:10:7:
      10 │ import '../latex-commands/definitions';
         ╵        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


✘ [ERROR] TS2882: Cannot find module or type declarations for side-effect import of '../core/modes'. [plugin angular-compiler]

    node_modules/mathlive/types/mathlive-ssr.d.ts:13:7:
      13 │ import '../core/modes';
         ╵        ~~~~~~~~~~~~~~~

Workaround: in tsconfig.json

    "noUncheckedSideEffectImports": false,

Typescript 6 documentation

https://devblogs.microsoft.com/typescript/announcing-typescript-6-0/
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-6-0.html

noUncheckedSideEffectImports is now true by default: This helps catch issues with typos in side-effect-only imports.

According to GPT:

  • The declaration file types/mathlive-ssr.d.ts contains side-effect imports '../core/math-environment', '../latex-commands/definitions', '../core/modes', but those module paths do not exist in the published package and have no corresponding type declarations.
  • TypeScript 6 now reports these missing side-effect imports as TS2882.
  • The fix is to either publish those referenced modules/declarations, remove the stale side-effect imports from the .d.ts, or replace them with valid exported/importable paths that exist in the npm package.

Activity

  1. added a commit that references this issue on Jun 10, 2026
    25db1a8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions