The image fails to display when using THREE.js and Panolens.js

Trying to create a 360-degree environment with informational buttons using THREE.js and Panolens.JS

However, I'm unable to resolve why the image is not appearing.

Continuously encountering the error: Uncaught ReferenceError: process is not defined.

Anyone know where this issue is originating from?

<body>
            <script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="bfcbd7cddadaff8f918e8d8d918f">[email protected]</a>/build/three.min.js"></script>
            <script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6515040b0a09000b1625554b54554b">[email protected]</a>/build/panolens.min.js"></script>


            <style>
                html, body {
                    width: 100%;
                    height: 100%;
                    overflow: hidden;
                    margin: 0;
                }
                
                body {
                    background-color: bisque;
                }
                
                #container {
                    margin-left: auto;
                    margin-right: auto;
                    margin-top: 10px;
                    width: 700px;
                    height: 400px;
                }
                
            </style>
            
            <div id="container"></div>

            <script>

                var panorama, viewer, container, infospot;
                var containerBaseWidth = 700;
                var containerBaseHeight = 400;
                var deltaSize = 100;

                container = document.querySelector('#container');

                panorama = new PANOLENS.ImagePanorama('https://pannellum.org/images/alma.jpg');

                infospot = new PANOLENS.Infospot(350, PANOLENS.DataImage.Info);
                infospot.position.set(0, 0, -5000);
                infospot.addHoverText('TEST PANOLENS', 30);
                panorama.add(infospot);

                viewer = new PANOLENS.Viewer({ container: container });
                viewer.add(panorama);

                function changeContainerSize(width, height) {
                    viewer.container.style.width = width + "px";
                    viewer.container.style.height = height + "px";
                    viewer.onWindowResize(width, height);
                }

            </script>

        </body>

Answer №1

There is a current github issue related to Panolens project that discusses this error:

Uncaught ReferenceError: process is not defined

This issue was opened recently.

Link to the github issue

Answer №2

To ensure functionality, I opted to store the unedited code from panolens.min.js within my local file instead of relying on an external URL link.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Encountering a React clash while integrating Material UI

Upon trying to utilize the AppBar feature in Material UI version 0.16.6, I encountered the following error: Uncaught Error: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created within a c ...

Console command to change paragraph tag color---Modifying the color

I am attempting to change the color of all paragraph tags on a webpage to white by utilizing the console. My initial attempt was: document.p.style.color = 'white'; However, this method did not have the desired effect. Interestingly, I have had s ...

Modifying Background Images Dynamically with jQuery as You Scroll

Struggling to make my background image change while scrolling has been a challenge for me. I've tried different solutions suggested for similar questions, but so far no success - it only displays the initial background image. The setup involves havin ...

Error in Internet Explorer 8 - the object does not support this property or method

My ExtJS custom "treecombo" works perfectly in Firefox and Chrome, but encounters issues in Internet Explorer. Specifically, I am facing problems with IE8 when trying to run the following code: Ext.define('MyApp.plugins.TreeCombo', { extend: & ...

Only carry out a redirect to the specified page if the successRedirect is present in the passport.authenticate function

Encountering some difficulties with a Node Express app. After removing the successRedirect property in the auth method by passport, it fails to redirect. The below code does not redirect to the desired page when the successRedirect is removed and replaced ...

Is there a way to verify that all CSS files have been successfully downloaded before injecting HTML with JavaScript?

I am looking to dynamically inject HTML content and CSS URLs using JavaScript. I have more than 3 CSS files that need to be downloaded before the content can be displayed on the page. Is there a way to check if the aforementioned CSS files have finished ...

Adjust the navigation menu to display or hide as the page is being scrolled

Implementing an offset to display/hide the navigation menu when the page is scrolled 100px. Attempted to modify from lastScroll = 0 to lastScroll = 100 but it did not work as expected. Jquery: Fiddle // Script lastScroll = 0; $(window).on('scroll&ap ...

Tips for utilizing rowspan and colspan in BootstrapTable

I am creating a table using bootrapTable and would like to know how I can use rowspan or colspan to achieve a table layout similar to the one shown in this image: Click here for image description $table.bootstrapTable({ columns: [{ ...

Does LABJS include a feature for executing a callback function in the event of a timeout during loading?

When using LabJS to asynchronously load scripts with a chain of dependencies, if one of the scripts breaks (due to download failure or connection timeout), it seems that the remaining scripts in the chain will not be executed. Is there a way to define a ...

The placement of text appears to be incorrect when applying the float:left property in CSS

My issue is that I want #text1 to display on the right side of #video1, and #text2 to be positioned next to #video2. However, currently #text2 is also appearing beside #video1. Can someone please explain why this is happening and provide a solution to fi ...

Executing two distinct SQL queries within one nodejs function

I'm facing an issue with updating two tables in my database - the stockmaster table and the prodstock table. I've been trying to run a query using a function to update both tables simultaneously, but unfortunately, it's not working as expect ...

Clicking on the mail icon will open the mail with the associated mail id

When the mail icon is clicked, the mail will open with this email address. I am currently working on a project where clicking the mail icon will redirect to the mail signup page with the corresponding email address. In the image below, the red border ind ...

Retrieve the present value from a Selectpicker using jQuery within the Codeigniter Framework

I attempted to use DOM manipulation to retrieve the value of the currently selected option from the selectpicker. My goal was to have the value of the selectpicker id="service_provider_select" printed first. However, whenever I changed the option using the ...

What is the best way to delete a CSS class from a specific element in a list using React?

I need to implement a functionality in React that removes a specific CSS class from an item when clicking on that item's button, triggering the appearance of a menu. Here is my code snippet. import "./Homepage.css" import React, { useState, ...

Creating asynchronous JavaScript constructors using a static method called "create" presents challenges when dealing with TypeScript types

I've been diving into the world of asynchronous constructors and have successfully implemented them in JavaScript. However, I'm facing a challenge with TypeScript types. Here's how it should ideally work: const a: AnyClass = await AnyClass. ...

Executing "mounted" in VueJS SSR with Quasar: A step-by-step guide

In accordance with the documentation: Given that there are no dynamic updates, only beforeCreate and created Vue lifecycle hooks will be triggered during SSR. This implies that any code within other lifecycle hooks like beforeMount or mounted will sole ...

Animate specifically new items in a list rendered via ngFor in Angular animation

I am working with a list of array items in an ngFor loop. I have a basic button that adds an item to the array. My goal is to apply an animation only to the newly added items, but currently all the existing list items also receive the animation upon page l ...

Is it common in Node.js to create multiple instances of "server" objects, but only connect one to a port?

After finishing "Node.js in Action", I'm now piecing together the concepts of Node.js, Connect, and Express. My inquiry revolves around the creation of servers in Node. node_server = http.createServer(); connect_app = Connect(); express_app = Express ...

The PHP code for displaying a button with an onclick event may experience functionality issues

I've attempted to display the button using echo, but for some reason the link isn't functioning properly. I believe there may be an issue with the href link, could you please assist? echo "<input class='button_normal' type='but ...

I'm currently learning about things that never change and struggling to grasp their meaning

I'm currently delving into the world of immutable.js record and trying to wrap my head around it. However, this particular piece of code is really throwing me for a loop. Here's my Question: I understand [import, export,const], but what ex ...