Tips for enhancing Chevrotain within VRMLLoader

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.

Answer №1

I have submitted a PR on GitHub to upgrade the chevrotain library to version 9.0.1. You can view the PR here: https://github.com/mrdoob/three.js/pull/21694.

The upcoming release r128 at the end of April is expected to resolve this issue.

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

Using Selectpicker with Jquery .on('change') results in the change event being triggered twice in a row

While utilizing bootstrap-select selectpicker for <select> lists, I am encountering an issue where the on change event is being triggered twice. Here is an example of my select list: <select class="form-control selectpicker label-picker" ...

Javascript function is providing unexpected output

I have a function that should display 4 different flags, but it's not working as expected. There are no error messages, but the flags are not being printed either. I've tried everything I could think of and now I'm stuck. Can someone please ...

I require the slideshow div to smoothly move elements down as it transitions between slides

I'm facing an issue with a jquery slideshow that contains quotes of varying lengths. The problem is, the longer quotes overlap with the content below them. I'm trying to figure out how to make the longer quotes push the rest of the page down, avo ...

Tips for effectively handling numerous iterations of an identical NPM dependency

Situation I have been working on creating various D3.js charts using the latest version of D3 (4.9.1). However, I also need to incorporate occasional C3.js charts into my application, which poses a challenge as C3 requires D3 v3.5.0. Exploring Options ...

"Converting circular structure into JSON" - Inserting BigQuery Data using Cloud Function in Node.js

I am currently facing an issue while attempting to load an array of JSON objects into a BigQuery Table from a Cloud Function built in NodeJS. Despite not having any circular references, I encountered the error message "Converting circular structure to JSON ...

The innerHTML function in jQuery seems to be malfunctioning

My div isn't displaying the expected content. This is my controller action: /// <summary> /// GetCountiresForManufacturer /// </summary> /// <returns></returns> [Authorize(Roles = "Administrator")] [Ac ...

Error: The callback function is no longer supported in Model.find() in Mongoose

I am having trouble retrieving all users from the database because I keep getting an error that says Model.find() no longer accepts a callback. Can someone please help me understand how to fetch data from my mongodb database? router.get('/users', ...

What is the best approach to link an HTML document to a MySQL Workbench server utilizing JavaScript, Ajax, and PHP?

On my HTML page, users can enter the name of a movie and if it is found in the database, the name will be displayed. I am attempting to establish a connection to the MySQL Workbench Server using JavaScript, Ajax, and PHP. This is what I have implemented s ...

Chrome runs requestAnimFrame at a smooth 60 frames per second, while Firefox struggles to keep up at

I recently developed a canvas animation using requestAnimFrame and saw great results in Chrome. However, when I viewed it in Firefox, it seemed like a slideshow was running instead of a smooth animation. I'm unsure what could be causing this issue. F ...

Meteor JS failed to load the CSS file due to an unsupported MIME type

Currently, I am working on a meteor js 1.8 app. I have created a layout and now I want to add CSS to it. Here is the structure I am following: imports -ui --stylesheets --bootstrap.min.css --font-awesome.min.css --skins.css --forms.css All my CSS files ...

What is the method to extract mimeType from an HTMLImageElement?

After researching the MDN documentation on HTMLImageElement, I found no mention of the mimeType. I did come across some resources explaining how to retrieve the mimeType from a File Object. However, my specific requirement is to extract the mimeType from ...

Encountered an Uncaught ChunkLoadError with Vercel Next.js: Chunk 0 failed to load

Upon removing the node modules and package-lock.json files, I encountered the error mentioned above when attempting to reload any page. The project works fine after being restarted for the first time. However, upon reloading the page again, it displays a b ...

What is the process for creating a new Object based on an interface in Typescript?

I am dealing with an interface that looks like this: interface Response { items: { productId: string; productName: string; price: number; }[] } interface APIResponse { items: { productId: string; produc ...

Issue with module exports not being defined in IE11/Edge

I am experiencing difficulties with an npm module that was updated to ES2015. My application is built in ES2015, bundled by browserify, and compiled with babelify. I am currently trying to upgrade a npm module called credit-card for validation, which has ...

The margin data table unexpectedly grew on its own following the action of toggling column visibility

The margin table data mysteriously increased on its own after hiding / showing columns. Here is the original result before show/hide column: https://i.sstatic.net/N96HX.png After multiple show/hide actions (more than 10 times): https://i.sstatic.net/lPIG ...

How to Enhance GraphQL Mutation OutputFields with a Function Generator

I'm encountering issues while trying to incorporate a function generator within a GraphQL mutation. The function generator is utilized to streamline the promise chain inside the mutation. Prior to refactoring the code, everything was functioning corr ...

There was an error in locating the JavaScript file within the Node.js Express Handlebars application

My website is not displaying the .js file, css file, or image from the public folder. Here are the errors showing up in the console: GET http://localhost:8080/assets/images/burger.jpg 404 (Not Found) GET http://localhost:8080/burgers.js net::ERR_ABORTED ...

What is the process for activating the currently active tab or link within the MDBNav component of MDBreact?

Here is the code snippet I am working with: import React from "react"; import { BrowserRouter } from 'react-router-dom'; import { MDBNav, MDBNavItem, MDBNavLink } from "mdbreact"; const CustomTabs = props => { return ( <BrowserRouter& ...

What is the reason behind this HTML/CSS/jQuery code functioning exclusively in CodePen?

I have encountered an issue where this code functions properly in JSFiddle, but not when run locally in Chrome or Firefox. I suspect there may be an error in how the CSS or JavaScript files are being linked. In the Firefox console, I am receiving an error ...

Can commands be loaded directly into spec.js files in Cypress instead of support/index.js?

Whenever a new file containing Cypress custom commands is written, it is typically added using Cypress.Commands.add() and then imported into support/index.js. The issue arises when dealing with 100 such Custom command files, as loading all of them every t ...