reactjs / reactjs/react.dev

Handle three gatsby-remark-prismjs warnings during build

Open
#5,066 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
11.8k
Forks
7.9k
Avg merge
1d 11h
Merged PRs (30d)
11

Description

Is this a desired choice? To have generic code blocks in gatsby-remark-prismjs?

When running "yarn dev" the three following warnings occurs.

warn unable to find prism language 'sh' for highlighting. applying generic code block
warn unable to find prism language 'jsxon' for highlighting. applying generic code block
warn unable to find prism language 'console' for highlighting. applying generic code block

These warnings can be prevented by adding one line in gatsby-config.js on line 86.

'gatsby-remark-use-jsx',
          {
            resolve: 'gatsby-remark-prismjs',
            options: {
              classPrefix: 'gatsby-code-',
              aliases: {sh: 'bash', jsxon: 'jsx', console: 'bash'}, < ---
            },
          },

But maybe we want to generic code blocks?

Contributor guide

Open the contributing guide

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

Review gatsby-config.js around line 86 and the reported gatsby-remark-prismjs warnings. Run "yarn dev" to confirm the sh, jsxon, and console warnings, then determine whether adding the listed aliases is the intended configuration and verify the warnings are resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system, documentation
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.