Recast reference is not defined from RecastJSPlugin

i’m following ‘Create a Navigation Mesh’ tutorial from official docs
But when i added the plugin and initialized it, i got an error that i mentioned in title.
Is there additional steps that i need to prepare before using the plugin?

import
{
  RecastJSPlugin,
} from "@babylonjs/core";

let navigationPlugin = new RecastJSPlugin();

Did you await Recast(); before instantiating the plugin ?

No, Is it included in babylonjs package? or do i need to build it myself to use it?

Here is the example - https://github.com/RaananW/babylonjs-webpack-es6/blob/master/src/scenes/navigationMeshRecast.ts

You already did

import { RecastJSPlugin } from "@babylonjs/core/Navigation/Plugins/recastJSPlugin";

Need to add

import Recast from "recast-detour";

And then

        const recast = await Recast()

Oh thanks, i will try it nows

This is my import statements

import {
  MeshBuilder,
  Scene,
  Color3,
  AbstractMesh,
  SceneLoader,
  ActionManager,
  ExecuteCodeAction,
  Mesh,
  Vector3,
  RecastJSPlugin,
  StandardMaterial,
} from "@babylonjs/core";
import { Button, AdvancedDynamicTexture } from "@babylonjs/gui";
import Recast from "recast-detour";

And this is the part of my level code to set up navigation plugin.

 public async SetupNavigationPlugin() {
    const recast = await Recast();
    let tempGround = MeshBuilder.CreateGround("test_ground", {
      width: 10,
      height: 10,
      subdivisions: 20,
    });
    let navigationPlugin = new RecastJSPlugin();
    navigationPlugin.createNavMesh(
      [tempGround, this._outlineCollisionBox],
      NAV_PARAMETERS
    );

    var navmeshdebug = navigationPlugin.createDebugNavMesh(this.scene);
    navmeshdebug.position = new Vector3(0, 0.01, 0);

    var matdebug = new StandardMaterial("matdebug", this.scene);
    matdebug.diffuseColor = new Color3(0.1, 0.2, 1);
    matdebug.alpha = 0.2;
    navmeshdebug.material = matdebug;
  }

But i still getting this error whenever i run the code.
Errors below:
“recast.es6.js:9 Uncaught (in promise) TypeError: Cannot set properties of undefined (setting ‘Recast’)
at recast.es6.js:9:565757
at Level.SetupNavigationPlugin (Level.ts:103:26)
at new Level (Level.ts:99:10)”

at World.ts:57:21