Skip to content

Frankdoc Library useFFDoc hook does not work outside of an Angular project #431

@Daan0709

Description

@Daan0709

Problem

I cannot seem to make the useFFDoc hook of the ff-doc library work inside of my react app. Attempting to use the hook throws me the following exception

Error: The directive '_JavadocTransformDirective' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available.

The directive is part of a library that has been partially compiled.
However, the Angular Linker has not processed the library such that JIT compilation is used as fallback.

Ideally, the library is processed using the Angular Linker to become fully AOT compiled.
Alternatively, the JIT compiler should be loaded by bootstrapping using '@angular/platform-browser-dynamic' or '@angular/platform-server',
or manually provide the compiler with 'import "@angular/compiler";' before bootstrapping.

Example code producing this error:

import { useFFDoc } from '@frankframework/ff-doc';

function App() {
    const { elements } = useFFDoc('https://frankdoc.frankframework.org/js/frankdoc.json');

    return (
        <div>
              Hi FFDoc!
        </div>
    );
}

export default App;

The useFFDoc hook seems to still rely on being used within an angular project. Is there some possibility to use the hook outside of the context of an angular project, or would I have to implement a React wrapper component like in the React Implementation Component?

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions