Skip to content
This repository has been archived by the owner on Apr 21, 2021. It is now read-only.

Compatibility Error with Terser (and the simple fix) #95

Open
AlexMViver opened this issue Dec 5, 2020 · 1 comment
Open

Compatibility Error with Terser (and the simple fix) #95

AlexMViver opened this issue Dec 5, 2020 · 1 comment

Comments

@AlexMViver
Copy link

When compiling an angular app that uses terser for production use the following error occurs compiling ThreeBox code:

Error: main.1a5fcd07c173571f6663.js from Terser Unexpected token: name (static) [main.1a5fcd07c173571f6663.js:5215,28] at js_error (C:\Users\Alex\Documents\Lapr5\SPA\node_modules\terser\dist\bundle.min.js:538:11) at croak (C:\Users\Alex\Documents\Lapr5\SPA\node_modules\terser\dist\bundle.min.js:1251:9) at token_error (C:\Users\Alex\Documents\Lapr5\SPA\node_modules\terser\dist\bundle.min.js:1259:9) at unexpected (C:\Users\Alex\Documents\Lapr5\SPA\node_modules\terser\dist\bundle.min.js:1265:9) at Object.add_parameter (C:\Users\Alex\Documents\Lapr5\SPA\node_modules\terser\dist\bundle.min.js:1736:33) at binding_element (C:\Users\Alex\Documents\Lapr5\SPA\node_modules\terser\dist\bundle.min.js:1993:29) at parameter (C:\Users\Alex\Documents\Lapr5\SPA\node_modules\terser\dist\bundle.min.js:1800:17) at parameters (C:\Users\Alex\Documents\Lapr5\SPA\node_modules\terser\dist\bundle.min.js:1774:25) at _function_body (C:\Users\Alex\Documents\Lapr5\SPA\node_modules\terser\dist\bundle.min.js:2047:19) at function_ (C:\Users\Alex\Documents\Lapr5\SPA\node_modules\terser\dist\bundle.min.js:1698:20)

Although I do not know terser's behavior the error is simply resolved by changing the variable 'static' name to another (non-reserved token) name.

The referred variable is located in src/objects/objects.js in the addMethods function.

@AlexMViver AlexMViver changed the title Compatibility Error with Terser Compatibility Error with Terser (and the simple fix) Dec 5, 2020
@jscastro76
Copy link

jscastro76 commented Dec 5, 2020

Hi @AlexMViver
Just FYI, since a year ago I’m maintaining a new fork from Threebox with many new features (that is also in production) such as the following:

  • Update to Three.js v117.
  • Update to Mapbox-gl-js v1.11.1.
  • 18 examples with new features.
  • Support for multiple 3D format objects (FBX, GLTF/GLB, Collada, OBJ/MTL).
  • Support for CSS2D labels supporting rich HTML controls through a new LabelManager.
  • Support for CSS2D tooltips/title browser-like and mapbox-like.
  • Support for built-in shadows and real Sun light positioning for a given datetime and lnglat coords.
  • Support for built-in Raycaster in loaded Object3D and fill-extrusions together.
  • Support for built-in MouseOver/Mouseout, Selected, Drag&Drop, Drag&Rotate, Wireframe in loadedObjects including events.
  • Support for GeoJson standard features format import and export in different layers.
  • Support for Object3D embedded animations, and combined animations on AnimationManager (i.e. translate + embedded).
  • Support for multi-floor design of spaces.
  • Support for Non-AABB Non Axes Aligned Bounding Box and real model size.
  • Support for wireframing on Object3D, removing them from the raycast.
  • Support for setLayerZoomRange and setLayoutProperty on Custom Layers (not available in Mapbox).
  • Support for removeLayer considering Object3D.
  • Support for style change through setStyle and keeping Object3D.
  • Support for partial and full dispose of Mapbox, Three and Threebox resources and memory.
  • Support for Object3D auto-centering, bounding box and floor projection.
  • Optimization for loading thousands of objects through cache.
  • Optimization of Camera perspective to have Raycast with pixel-precision level.
  • Available as npm package

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants