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

Relative path of worker.js cause loading error when using pviewer as a front end component #201

Closed
portwatcher opened this issue Jul 6, 2021 · 1 comment

Comments

@portwatcher
Copy link

portwatcher commented Jul 6, 2021

This line
https://github.com/PrismarineJS/prismarine-viewer/blob/master/viewer/lib/worldrenderer.js#L22
decides pviewer to load woker.js relative to present path of where pviewer is used.

Say we have wrapped a "schematic renderer" component and use it in our project. Typically this component will be used under the path like domain/foo/bar/:id, and pviewer will request worker.js at domain/foo/bar/worker.js not domain/worker.js

Not only worker.js, JSON files of blockStates, etc, have the same problem.

@portwatcher
Copy link
Author

Temporarily I decide to setup a independent web site that provide rendering at / and use it through iframe

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

1 participant