-
Preliminary Checks
DescriptionAfter installing gatsby-remark-prismjs according to the documentation, no code highlighting happens. Two similar issues whose solutions didn't solve this:
Reproduction Linkhttps://github.com/luisds95/gatsby-prismjs-issue Steps to Reproduce
Expected ResultActual ResultEnvironmentSystem:
OS: Linux 4.19 Ubuntu 20.04.3 LTS (Focal Fossa)
CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 16.13.2 - ~/.nvm/versions/node/v16.13.2/bin/node
Yarn: 1.22.18 - ~/.nvm/versions/node/v16.13.2/bin/yarn
npm: 8.1.2 - ~/.nvm/versions/node/v16.13.2/bin/npm
npmPackages:
gatsby: ^4.10.0 => 4.10.0
gatsby-plugin-mdx: ^3.10.1 => 3.10.1
gatsby-remark-prismjs: ^6.10.0 => 6.10.0
gatsby-source-filesystem: ^4.10.0 => 4.10.0
gatsby-transformer-remark: ^5.10.1 => 5.10.1
npmGlobalPackages:
gatsby-cli: 4.9.1 Config FlagsNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I'm happy to have a look if someone can point me into how to debug this (i.e. how to get some logs of what's happening on build time) |
Beta Was this translation helpful? Give feedback.
-
Hi! When you use You'll want to remove While people often use solutions like prism-react-renderer, the |
Beta Was this translation helpful? Give feedback.
Hi!
When you use
gatsby-plugin-mdx
there is no need forgatsby-transformer-remark
as the latter is only for markdown files, but you're writing MDX files (the former also supports plain markdown). So configuringgatsby-transformer-remark
won't change the behavior of the MDX plugin.You'll want to remove
gatsby-transformer-remark
and put thegatsby-remark-prismjs
configuration inside theremarkPlugins
key ofgatsby-plugin-mdx
: https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#gatsby-remark-pluginsWhile people often use solutions like prism-react-renderer, the
gatsby-remark-prismjs
package should still work.