PrismJS / PrismJS/prism

Property 'languages' does not exist on type 'typeof import("prismjs")'.

Open
#2,486 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
13k
Forks
1.4k
Avg merge
15h 36m
Merged PRs (30d)
3

Description

Information:

  • Prism version: latest from the download page
  • Plugins: none
  • Environment: Angular 8.0

Description
I installed the prism.js through NPM and applied it in my angular.json, then use Prism through this in my components:
import * as Prism from 'prismjs';

Everything works well when I am in jit mode. But when I move to aot mode, the following error appears:
app/shared/components/components/chat-code-view-reply-dialog/chat-code-view-reply-dialog.component.ts:120:23 - error TS2339: Property 'languages' does not exist on type 'typeof import("prismjs")'.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Angular AOT build using the setup in angular.json and the import in app/shared/components/components/chat-code-view-reply-dialog/chat-code-view-reply-dialog.component.ts. Inspect Prism's published type declarations around the languages export; done means the component compiles in AOT mode without TS2339 while retaining the existing Prism usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, javascript, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.