Troubleshooting language grammar for markdown react

Hi. I’m trying to port a language grammar for Markdown React (mdx) from VS Code. For the grammar cson file, see below. The grammar is recognized but it only correctly highlights the markdown bits, whereas the react import/export commands, or components remain unhighlighted. I would greatly appreciate any tips you may have.

scopeName: 'source.mdxjs'
name: 'Markdown React (mdx)'
fileTypes: [
  'mdx'
]
patterns: [
  { include: '#react'}
  { include: '#markdown'}
]
repository: {
  react: {
    patterns: [
      { include: '#jsxModule' }
      { include: '#jsxTag' }
    ]
    repository: {
      jsxModule: {
        patterns: [
          {
            begin: '^(?=(import|export)\\b)'
            while: '^(?!\\s*$)'
            contentName: 'source.js.jsx'
            patterns: [
              { include: 'source.js.jsx' }
            ]
          }
        ]
      }
      jsxTag: {
        patterns: [
          {
            begin: '^(?=<([a-z]|[A-Z]))'
            end: '(?<=>)'
            contentName: 'source.js.jsx'
            patterns: [
              { include: 'source.js.jsx' }
            ]
          }
        ]
      }
    }
  }
  markdown: {
    contentName: 'source.gfm'
    patterns: [
      { include: 'source.gfm' }
    ]
  }
}

I believe only a single root level repository is permitted

thanks! i reorganized the code without nested repositories, and it worked.