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

Getting blockTokenizers is undefined when using in my Gatsby app #486

Closed
OddDev opened this issue Feb 7, 2023 · 1 comment
Closed

Getting blockTokenizers is undefined when using in my Gatsby app #486

OddDev opened this issue Feb 7, 2023 · 1 comment

Comments

@OddDev
Copy link

OddDev commented Feb 7, 2023

Input:

	const postContent = unified()
		.use(rehypeParse)
		.use(remarkCustomBlocks, {
			foo: {
				classes: "a-class another-class",
			},
		})
		.use(rehype2react, {
			createElement: React.createElement,
			components: {
				h1: TestHeadline,
				p: TestParagraph,
			},
			Fragment: React.Fragment,
		})
		.processSync(html).result as ReactElement;

Result:

Unhandled Runtime Error

One unhandled runtime error found in your files. See the list below to fix it:

Error in function blockPlugin in ./node_modules/remark-custom-blocks/dist/index.js:74

blockTokenizers is undefined
./node_modules/remark-custom-blocks/dist/index.js:74

  72 |   var blockTokenizers = Parser.prototype.blockTokenizers;
  73 |   var blockMethods = Parser.prototype.blockMethods;
> 74 |   blockTokenizers.custom_blocks = blockTokenizer;
  75 |   blockMethods.splice(blockMethods.indexOf('fencedCode') + 1, 0, 'custom_blocks');
  76 |
  77 |   // Inject into interrupt rules

I get an error when trying to use custom blocks in my project. I'm a bit lost on how to debug this issue. Can you point me in the right direction? :) Thank you!

@StaloneLab
Copy link
Member

Hello, from what I see it might be linked to your version of remark being too recent for our plugins (more like our plugins being too old for the current version). Please see issue #416 , especially my latest message from yesterday. If you think it does not apply to your problem, please specify the version of remark you are using, we only support remark < 13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants