protobuffet / docusaurus-protobuffet

Docusaurus toolset for Protobuf contract documentation.
https://protobuffet.com
ISC License
38 stars 8 forks source link

MDX compilation failed #11

Open dhia-gharsallaoui opened 9 months ago

dhia-gharsallaoui commented 9 months ago

Hello, I am trying to setup docusaurus-protobuffet to my docusaurus website.

After adding the docusaurus-protobuffet config to my docusaurus.config.js file

{
  presets: [
    [
      'classic',
      /** @type {import('@docusaurus/preset-classic').Options} */
      ({
        docs: {
          sidebarPath: './sidebars.ts',
      routeBasePath: '/',
        },
        blog: false,
      }),
    ],
    [
      'docusaurus-protobuffet',
      {
        protobuffet: {
          fileDescriptorsPath: '/protos/protos.json',
      protoDocsPath: './docs',
          sidebarPath: './sidebars.ts'
        },
        docs: {
          routeBasePath: 'docs',
          sidebarPath: './sidebars.ts',
        }
      }
    ]
  ]
}

I got this error for all generated and old files even the .md file.

Error: MDX compilation failed for file "/site/docs/01_architecture/01_database.md"
Cause: Unexpected `FunctionDeclaration` in code: only import/exports are supported
Details:
{
  "column": 1,
  "message": "Unexpected `FunctionDeclaration` in code: only import/exports are supported",
  "line": 52,
  "name": "52:1-168:2",
  "place": {
    "start": {
      "line": 52,
      "column": 1,
      "offset": 1468
    },
    "end": {
      "line": 168,
      "column": 2,
      "offset": 8120
    }
  },
  "reason": "Unexpected `FunctionDeclaration` in code: only import/exports are supported",
  "ruleId": "non-esm",
  "source": "micromark-extension-mdxjs-esm",
  "url": "https://github.com/micromark/micromark-extension-mdxjs-esm#unexpected-type-in-code-only-importexports-are-supported"
}
zsedem commented 8 months ago

same here

Cause: Unexpected `FunctionDeclaration` in code: only import/exports are supported
Details:
{
  "column": 1,
  "message": "Unexpected `FunctionDeclaration` in code: only import/exports are supported",
  "line": 48,
  "name": "48:1-123:2",
  "place": {
    "start": {
      "line": 48,
      "column": 1,
      "offset": 1298
    },
    "end": {
      "line": 123,
      "column": 2,
      "offset": 7515
    }
  },
  "reason": "Unexpected `FunctionDeclaration` in code: only import/exports are supported",
  "ruleId": "non-esm",
  "source": "micromark-extension-mdxjs-esm",
  "url": "https://github.com/micromark/micromark-extension-mdxjs-esm#unexpected-type-in-code-only-importexports-are-supported"
}
lpicchi commented 1 month ago

Please share generated md if possible