After encountering a dilemma, I found a solution by referencing an answer I previously provided in a different discussion: link
Recently, I stumbled upon a fascinating project and was intrigued by its functionality. In essence, it operates as a Single Page Application (SPA). Implementing this approach in my own project yielded successful results.
In the nuxt.config.js
export default {
mode: "spa",
..
Evidently, the issue at hand pertains to server-side rendering.
------ Insights on Universal Mode ------
In striving for universal integration within my application, I experimented with conditionally importing plugins.
It's important to note that the following method is ineffective. Nonetheless, I present it as another avenue of exploration for situations where SPA implementation may not be feasible.
Transfer
import Vue from 'vue'
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls"
Vue.use(OrbitControls)
to a file named threeimports.js within the plugins directory and append
plugins: [
{ src :"~/plugins/threeimports.js", ssr: false},
..
to the nuxt.config.js
Initially, I assumed that OrbitControls would be globally accessible throughout the project, but that wasn't the case. The root cause lies in the curly bracket syntax, which differs from how other modules are integrated successfully without utilizing brackets.