Sdv.concat.min.js library breaking other library imports in Wordpress


(Sean) #1

Hello,

I am having a problem with importing the library to run a 3D display while also rendering inputs from another plugin within Wordpress. It seems that the non concat lib works just fine and doesn’t break the other imports, but something about the bundled concat lib is breaking the other imports. I can post the errors from the other libraries if needed. Is there a way to include the proper dependencies in a non-minified format?

Cheers,
Sean


(Alexander Schiftner) #2

sdv.concat.min.js bundles THREE, verb-nurbs, and axios with the minified viewer. All of these are required dependencies, our viewer won’t work without them. What let’s you to believe that there is a problem with sdv.concat.min.js?
Remark: We are using sdv.concat.min.js on our marketing website which is powered by WordPress.


(Sean) #3

When I have included the sdv.concat.min.js lib these errors pop out:

iris.min.js?ver=5.1:4 Uncaught ReferenceError: module is not defined
at iris.min.js?ver=5.1:4
at iris.min.js?ver=5.1:4
(anonymous) @ iris.min.js?ver=5.1:4
(anonymous) @ iris.min.js?ver=5.1:4
ion.rangeSlider.min.js?ver=2.2.0:2 Uncaught ReferenceError: require is not defined
at ion.rangeSlider.min.js?ver=2.2.0:2
at ion.rangeSlider.min.js?ver=2.2.0:2
(anonymous) @ ion.rangeSlider.min.js?ver=2.2.0:2
(anonymous) @ ion.rangeSlider.min.js?ver=2.2.0:2
js.cookie.min.js?ver=2.1.4:8 Uncaught ReferenceError: module is not defined
at js.cookie.min.js?ver=2.1.4:8
at js.cookie.min.js?ver=2.1.4:8
(anonymous) @ js.cookie.min.js?ver=2.1.4:8
(anonymous) @ js.cookie.min.js?ver=2.1.4:8
frontend.js?ver=4.4.9:1675 Uncaught ReferenceError: _ is not defined
at frontend.js?ver=4.4.9:1675
(anonymous) @ frontend.js?ver=4.4.9:1675
photoswipe.min.js?ver=4.1.1:4 Uncaught ReferenceError: module is not defined
at photoswipe.min.js?ver=4.1.1:4
at photoswipe.min.js?ver=4.1.1:4
(anonymous) @ photoswipe.min.js?ver=4.1.1:4
(anonymous) @ photoswipe.min.js?ver=4.1.1:4
photoswipe-ui-default.min.js?ver=4.1.1:4 Uncaught ReferenceError: module is not defined
at photoswipe-ui-default.min.js?ver=4.1.1:4
at photoswipe-ui-default.min.js?ver=4.1.1:4
(anonymous) @ photoswipe-ui-default.min.js?ver=4.1.1:4
(anonymous) @ photoswipe-ui-default.min.js?ver=4.1.1:4
backbone.min.js?ver=1.2.3:1 Uncaught ReferenceError: require is not defined
at backbone.min.js?ver=1.2.3:1
at backbone.min.js?ver=1.2.3:1
(anonymous) @ backbone.min.js?ver=1.2.3:1
(anonymous) @ backbone.min.js?ver=1.2.3:1
notes-common-v2.js?ver=7.0.1-201909:32 Uncaught ReferenceError: Backbone is not defined
at notes-common-v2.js?ver=7.0.1-201909:32
at notes-common-v2.js?ver=7.0.1-201909:158
(anonymous) @ notes-common-v2.js?ver=7.0.1-201909:32
(anonymous) @ notes-common-v2.js?ver=7.0.1-201909:158
admin-bar-v2.js?ver=7.0.1-201909:2 Uncaught ReferenceError: _ is not defined
at admin-bar-v2.js?ver=7.0.1-201909:2
(anonymous) @ admin-bar-v2.js?ver=7.0.1-201909:2
woocommerce.min.js?ver=3.5.5:1 Uncaught ReferenceError: Cookies is not defined
at HTMLDocument.<anonymous> (woocommerce.min.js?ver=3.5.5:1)
at i (jquery.js?ver=1.12.4:2)
at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4:2)
at Function.ready (jquery.js?ver=1.12.4:2)
at HTMLDocument.K (jquery.js?ver=1.12.4:2)

When I have included just the sdv.min.js the errors don’t present themselves. This might be due to the nature of the plugins used, or the fact that the viewer doesn’t render (which I doubt). The main issue with these libraries is that the range sliders are no longer being loaded in, which talk to the woocomerce back end via the uni-cpo plugin. I was going to use those elements to provide control to the viewer.

Which versions of THREE, verb-nurbs, and axios are needed to run the api 2.5.0 properly?


(Alexander Schiftner) #4

It’s these versions:

"three": "^0.95.0",
"axios": "^0.18.0",
"verb-nurbs": "^2.0.2"

(Alexander Schiftner) #5

@sean4 has your problem been solved?


(Sean) #6

I was able to include the dependencies on their own, and that did not seem to be the issue. The other libraries are still being broken and presenting the errors above. Not sure what is breaking them now.


(Sean) #7

I ended up solving it by including the sdv.concat.min.js after all the other plugins in the footer, then loading the parametric viewer after the page loads via the snippet in https://viewer.shapediver.com/v2/2.5.0/doc/usage.html

Hope this helps others if they run into this issue.