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

Gatsby 4: Type with name "GRVSCCodeSpan" does not exists #174

Open
TommasoAmici opened this issue Oct 21, 2021 · 8 comments
Open

Gatsby 4: Type with name "GRVSCCodeSpan" does not exists #174

TommasoAmici opened this issue Oct 21, 2021 · 8 comments
Labels
bug Something isn't working help wanted Would love a PR

Comments

@TommasoAmici
Copy link

When attempting to build my site with Gatsby 4.0.0 I get this error:

Type with name "GRVSCCodeSpan" does not exists
@andrewbranch andrewbranch added bug Something isn't working help wanted Would love a PR labels Oct 21, 2021
@andrewbranch
Copy link
Owner

I don’t currently have the bandwidth to update this for Gatsby 4, but gladly review a PR for it.

@dimitrisnl
Copy link

@andrewbranch Maybe someone from the Gatsby user collective can help ?

@wesbos
Copy link

wesbos commented Dec 3, 2021

I bet you can bypass all the gatsby stuff and just use the remark plugin directly. I'm trying this right now. Anyone else have success?

@wesbos
Copy link

wesbos commented Dec 3, 2021

Yeah that seems to have worked!

In your gatsby-config.js, remove the plugin from gatsbyRemarkPlugins and add remarkPlugins to your gatsby-plugin-mdx options

        remarkPlugins: [
          [require('gatsby-remark-vscode').remarkPlugin, {
              theme: `Cobalt2`,
              extensions: [`theme-cobalt2`],
          }]
        ],

@graysonhicks
Copy link

@N0K0
Copy link

N0K0 commented Jan 23, 2022

Yeah that seems to have worked!

In your gatsby-config.js, remove the plugin from gatsbyRemarkPlugins and add remarkPlugins to your gatsby-plugin-mdx options

        remarkPlugins: [
          [require('gatsby-remark-vscode').remarkPlugin, {
              theme: `Cobalt2`,
              extensions: [`theme-cobalt2`],
          }]
        ],

Where unable to make this approach work. Might be me wrongly configuring webpack 5 :')

Same issue both when resolving all the packages or just ignoring them like so

exports.onCreateWebpackConfig = ({ actions }) => {
  actions.setWebpackConfig({
    resolve: {
      fallback:{
        fs: false,
        os: false,
        path: false,
        zlib: false,
        crypto: false,
        stream: false,
        constants: false,
        module: false
      }
    }
  })
}

Something i noticed:

warn ./node_modules/gatsby-remark-vscode/src/processExtension.js
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
warn ./node_modules/gatsby-remark-vscode/src/processExtension.js
Critical dependency: the request of a dependency is an expression
warn ./node_modules/gatsby-remark-vscode/src/utils.js
Critical dependency: the request of a dependency is an expression

And of course: The page where i try to add the plugin
https://github.com/N0K0/gatsby-garden

@dimitrisnl
Copy link

Hey folks, gave it a try after reading @graysonhicks suggestions

Check it out if you would like: #185

@yehezkiell
Copy link

yehezkiell commented Feb 28, 2022

Yeah that seems to have worked!

In your gatsby-config.js, remove the plugin from gatsbyRemarkPlugins and add remarkPlugins to your gatsby-plugin-mdx options

        remarkPlugins: [
          [require('gatsby-remark-vscode').remarkPlugin, {
              theme: `Cobalt2`,
              extensions: [`theme-cobalt2`],
          }]
        ],

It works but I cant change theme in here

Gatsby version: 4.5.4
"gatsby-remark-vscode": "^3.3.1",

resolve: `gatsby-plugin-mdx`,
     options: {
       extensions: [".mdx", ".md"],
       remarkPlugins: [
         require("gatsby-remark-vscode").remarkPlugin,
         {
           theme: {
             default: "Solarized Light",
             dark: "Monokai Dimmed",
           },
           extensions: ["Kotlin"],
         },
       ],

@andrewbranch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Would love a PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants