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

console.error() is undefined #18

Closed
lwansbrough opened this issue Dec 24, 2016 · 6 comments
Closed

console.error() is undefined #18

lwansbrough opened this issue Dec 24, 2016 · 6 comments

Comments

@lwansbrough
Copy link

JavaScript runtime error: Object doesn't support property or method 'error'

warn, and log currently exist, should probably add support for the rest (info, error, etc.) to support existing JS libraries that may use them.

@Almost-Done
Copy link
Member

Thank you for filing this issue! This is now fixed and merged into master.

@liuminosity
Copy link

hey guys,

Amazing work on this! I have a very basic question related to this--where are these console methods outputting to? In Visual Studio, my Javascript Console is disabled, and I do not see anything in the Output box in Visual Studio. The app is rendering just fine (cone, cube, sphere) appear as normal

More info:
I am currently running the threejs sample app and am trying to put in DOM elements into the threejs scene. Ideally, I'd want to put iframes in and render webviews inside a holographic view. However, document.createElement() does not seem to working properly and would like to inspect if document is different than the normal one in a browser.

thanks!

@Almost-Done
Copy link
Member

@liuminosity The output is saved to an array in JavaScript and available under the debugger. It is not printed anywhere unfortunately. Can you please file a code issue for printing the messages to the output window?

DOM elements, and the document in general is not supported in HoloJS. Only a minimal subset of DOM elements and document functionality has been implemented to enable canvas rendering using WebGL: canvas element, 2D and WebGL contexts, Image and Video elements (no visuals, just decoding/manipulation/texturing). As such, you have to do all rendering in WebGL (or ThreeJS/WebGL)

If you want to show a flat web view on HoloLens, you can try using a WebView control in a XAML project. If you want to show an immersive web view on HoloLens, you will have to extend the DOM/document in HoloJS and implement 3D controls for the DOM elements. This is beyond the scope of this project and most probably a non-trivial task.

@liuminosity
Copy link

@Almost-Done thanks for the fast response! I'll submit a separate code issue for printing messages to the output window.

Appreciate the clarification on DOM elements. Since canvas (and I'm assuming canvas3d) elements are implemented, this means that I would be able to use a library like d3 directly on the canvas elements correct?

@Almost-Done
Copy link
Member

@liuminosity The 3D context is fully supported. If D3 can limit itself to the canvas and the 3d context it might work. If you run into difficulties please file code issues. Make sure you give the canvas3D to D3; it is the only canvas that renders to a visible surface. You can get it though document.createElement('canvas3D'). Any other canvas you create is off-screen.

The 2D canvas context is minimally implemented; only drawImage is implemented.

@liuminosity
Copy link

@Almost-Done got it--thanks for the help. I'll let you know of any troubles that I encounter!

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