babylon-vrm-loader
babylon-vrm-loader copied to clipboard
Error: Self is not defined
I'm loading this module just as shown in the example:
import * as BABYLON from "@babylonjs/core";
import 'babylon-vrm-loader'
in NextJS and Typescript.
The app crashes instantly:
Error [ReferenceError]: self is not defined
at Object.<anonymous> (C:\Users\Benjy\Documents\Github\project\s\node_modules\babylon-vrm-loader\dist\index.module.js:1:4903)
Not sure what's going on but would love a fix...
Following up:
I went into /dist/index.js
and /dist/index.module.js
and manually changed self
to this
;
Now I have the error:
Error [ERR_REQUIRE_ESM]: require() of ES Module C:\Users... \@babylonjs\core\Maths\math.js not supported.
Thank you for opening issue.
It may be ES target problem https://github.com/virtual-cast/babylon-vrm-loader/blob/master/tsconfig.json#L6 .
Could you share the minimum code that occurs this error, using CodeSandbox or something?