Skip to content

On NodeJS - TypeError: Cannot process without Compiler #63

@janaka

Description

@janaka

Hi,
Thanks for everybody's efforts on this project.

I've been having issues getting it to work on NodeJS and all things point to the issue being with remark-slate with Node. The same code worked fine in the browser within a React app. I want to use this on the backend to handle read/write from markdown persistence.

I've tried debugging myself but haven't made much progress. I've also tried different versions of dependencies with no luck.

Seems like somebody else has had issues trying to use for a similar use case. See thread here.

fwiw I seem to be making a bit more progress with remark-slate-transformer.

Any ideas?

Much appreciated.

My test code

  unified()
    .use(remarkParse)
    .use(remarkSlate)
    .process('[my link](https://github.com)', (err, file) => {
      if (err) throw err;
      if (!file) throw "file is undefined"
      console.log(file);
    });

The error thrown by Unified.
node_modules/unified/lib/index.js:520 the assertCompiler function.

TypeError: Cannot `process` without `Compiler`

with ESM + Typescript

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions