Currently facing an issue with loading vrml files into a three.js scene using the VRMLLoader bundled with three.
While everything works smoothly when running the project locally, encountering a failure in the onLoad function when loading from a built deployment due to source code minification. The error message reads:
Error: Terminal Token name: not found in rule:
Below is the complete stack trace for reference:
Error: Terminal Token name: <n> not found in rule: <version>
See: https://sap.github.io/chevrotain/docs/guide/resolving_grammar_errors.html#TERMINAL_NAME_NOT_FOUND
For Further details.
at chevrotain.module.min.js:2
at P (chevrotain.module.min.js:2)
...
The Github link provided in the stack trace points to an older repository of Chevrotain (here's the new repo). Further investigation led me to a newer version of the error troubleshooting page (here) which suggested that the embedded version of Chevrotain within VRMLLoader needs updating as it's outdated. For earlier versions and related issues, there's a dedicated troubleshooting page (link here).
It seems the problem stems from using Chevrotain versions <5.0 where minifying the source can cause such errors. Unfortunately, existing documentation doesn't offer concrete solutions due to this being addressed in newer Chevrotain releases.
The current configuration involves using the VRMLLoader shipped with three.js at the following file location:
import * as THREE from "three";
import { VRMLLoader } from 'three/examples/jsm/loaders/VRMLLoader.js'
Seeking advice on two main questions:
1. How can I update the Chevrotain files within the latest version examples of three.js?
2. Are there more effective methods to incorporate tools like VRMLLoader (besides importing from examples) in projects? This also applies to other utilities like OrbitControls.