-
-
Notifications
You must be signed in to change notification settings - Fork 695
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
PSV error when using plugins that were built from sources #1497
Comments
Did you put break points to check what is the actual value of Also try |
Thanks for your hint. I put a break point and checked the value of the GyroscopePlugin at the point when the viewer is instantiated together with the plugin. There is no difference between the version imported via npm and the local version. What I found out:
In this case the plugin works fine, as long as I use BTW, the import with "* as" makes no difference. The error remains the same |
for sure your locally built "Photo-Sphere-Viewer-main/packages/gyroscope-plugin/dist" has somewhere an import from "@photo-sphere-viewer/core" which resolves successfully if you also have the package available. The problem is that this check will never work because you actually have two different The solution : use the imports map as described in the setup guide https://photo-sphere-viewer.js.org/guide/#your-first-viewer |
<script type="importmap">
{
"imports": {
"three": "https://cdn.jsdelivr.net/npm/three/build/three.module.js",
"@photo-sphere-viewer/core": "../../Photo-Sphere-Viewer-main/packages/core/dist/index.module.js"
}
}
</script> |
If you use a bundler you will have to configure it properly to make |
Closing as not an issue with the lib. |
Thanks for your fast support! I got it running. Therefore I changed the package.json like this:
Then I could import the modules just like before:
|
Describe the bug
When I install the Photo-Sphere-Viewer and some plugins with npm everything works fine.
But as I need to modify an existing plugin (gyroscope) I try to build the plugin from sources. When this "self-built" plugin is added to the viewer, I receive the following error:
config.ts:216 Uncaught (in promise) PSVError: An undefined value was given for plugin 0.
There are no code modifications in the plugin. I'm just trying to get the build process running.
What I did so far:
cloned the Photo-Sphere-Viewer repository
npm install
npm run build
(builds without errors; build is available in dist folder)included this build in my project:
npm run build
(builds without errors)I tested the integration also with other plugins which did not work either. So I guess the issue is not specific for the gyroscope plugin.
Maybe this is no real bug, but I am just importing the build files in a wrong way? Can someone who has ever modiefied a plugin, share the steps to get this running? Thanks.
Online demo URL
No response
Photo Sphere Viewer version
5.11.1
Plugins loaded
Gyroscope
OS & browser
Windows, Chrome
Additional context
No response
The text was updated successfully, but these errors were encountered: