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 TypeError: this.initRoot is not a function #46

Closed
Nomackleo opened this issue Aug 22, 2024 · 3 comments
Closed

ERROR TypeError: this.initRoot is not a function #46

Nomackleo opened this issue Aug 22, 2024 · 3 comments

Comments

@Nomackleo
Copy link

I have a problem during the setup of Angular Three.

"dependencies": { "@angular/animations": "^18.1.0", "@angular/common": "^18.1.0", "@angular/compiler": "^18.1.0", "@angular/core": "^18.1.0", "@angular/forms": "^18.1.0", "@angular/platform-browser": "^18.1.0", "@angular/platform-browser-dynamic": "^18.1.0", "@angular/platform-server": "^18.1.0", "@angular/router": "^18.1.0", "@angular/ssr": "^18.1.3", "angular-three": "^2.0.0-beta.42", "express": "^4.18.2", "ngxtension": "^0.3.0", "rxjs": "~7.8.0", "three": "^0.155.0", "tslib": "^2.3.0", "zone.js": "~0.14.3" }, "devDependencies": { "@angular-devkit/build-angular": "^18.1.3", "@angular/cli": "^18.1.3", "@angular/compiler-cli": "^18.1.0", "@types/express": "^4.17.17", "@types/jasmine": "~5.1.0", "@types/node": "^18.18.0", "@types/three": "^0.155.0", "jasmine-core": "~5.1.0", "karma": "~6.4.0", "karma-chrome-launcher": "~3.2.0", "karma-coverage": "~2.2.0", "karma-jasmine": "~5.1.0", "karma-jasmine-html-reporter": "~2.1.0", "typescript": "~5.5.2" }

components:
`import {
ChangeDetectionStrategy,
Component,
CUSTOM_ELEMENTS_SCHEMA,
} from '@angular/core';
import { extend, NgtCanvas } from 'angular-three';
import { BoxGeometry, Mesh } from 'three';

extend({
Mesh,
BoxGeometry,
});

@component({
standalone: true,
template: <ngt-mesh> <ngt-box-geometry /> </ngt-mesh>,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class SceneGraph {}

@component({
selector: 'app-second-scene',
standalone: true,
imports: [NgtCanvas],
templateUrl: <ngt-canvas [sceneGraph]="sceneGraph"></ngt-canvas>,
styleUrl: './second-scene.component.css',
})
export class SecondSceneComponent {
readonly sceneGraph = SceneGraph;
}`

ERROR:
image

@elkestudio
Copy link

elkestudio commented Aug 23, 2024

Hi @Nomackleo for angular version 18.1.0 I'm using:

"angular-three": "^2.0.0-beta.257" and "three": "^0.166.1"

Keep in mind that library is still in beta

@Nomackleo
Copy link
Author

Hi @elkestudio, thank you for the help. I'll to try with those versions.

@nartc
Copy link
Member

nartc commented Sep 3, 2024

v2 has been released officially. Please check out the documentation for latest info: https://angularthree.org

@nartc nartc closed this as completed Sep 3, 2024
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

3 participants