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

Error: Self is not defined #110

Open
Benjythebee opened this issue Jul 10, 2023 · 2 comments
Open

Error: Self is not defined #110

Benjythebee opened this issue Jul 10, 2023 · 2 comments

Comments

@Benjythebee
Copy link

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...

@Benjythebee
Copy link
Author

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.

@yamayuski
Copy link
Contributor

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?

yamayuski pushed a commit to yamayuski/babylon-vrm-loader that referenced this issue Oct 23, 2023
fix: use original method of rendering outlines
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