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

XML3D.resource.registerFormatHandler is not a function #5

Open
OscarLiXi opened this issue Sep 7, 2016 · 3 comments
Open

XML3D.resource.registerFormatHandler is not a function #5

OscarLiXi opened this issue Sep 7, 2016 · 3 comments

Comments

@OscarLiXi
Copy link

Hi,

We are trying to render .stl file in XML3D 5.0, however the error message "XML3D.resource.registerFormatHandler is not a function" is shown in browser console.

Do we miss to run something? Also we are confused which server (in readme) we should run first?

Best regards,
Oscar

@csvurt
Copy link
Contributor

csvurt commented Sep 8, 2016

Hi,

sorry, the release descriptions were not right. Please try release 1.1.0 if you're using XML3D 5.0. The latest release (1.2.0) is only compatible with XML3D 5.1+. I just fixed the descriptions of the releases to reflect this.

This plugin does not need any special server. You should just configure your web server to deliver .stl files with the application/vnd.ms-pki.stl Content-Type header.

Starting with release 1.2.0 the plugin will also look for a .stl file ending if the Content-Type header is missing, so as long as either one of those things is present it will correctly render the STL file. If you can update your application to XML3D 5.1 or 5.2 (should be no changes necessary) then you can use version 1.2.0 of this plugin and not have to worry about configuring your web server.

@OscarLiXi
Copy link
Author

OscarLiXi commented Sep 13, 2016

Hi,

Is the example in release 1.2.0 correct? since it includes xml3d 5.0 instead of 5.1 or 5.2. We replace it with the latest xml3d 5.2, however we still meet an error "debug.js:61 TypeError: No FormatHandler could be found for the document http://localhost:63342/xml3d-stl-plugin-1.2.0/examples/resources/large-binary.stl(…) ", it seems the Content-Type is missing. If we set the isFormatSupport always to true, it can be rendered correctly. Is there other steps we are missing here?

Best regards,
Oscar

@csvurt
Copy link
Contributor

csvurt commented Sep 14, 2016

Sounds like there's still a mismatch between the version of the plugin and the XML3D version. I just pushed an update for the example that should match XML3D 5.2 with v1.2.0 of the plugin, can you check if this fixes it for you? It should detect the .stl file ending and return true in isFormatSupported, even if the server doesn't send the right Content-Type header for the STL file.

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