An attempt to use the viewer in a project with a typescript causes an error #3474
Unanswered
serhii1290
asked this question in
Q&A
Replies: 1 comment 4 replies
-
There are a number of users building MV in a TS environment, but the details tend to vary greatly depending on the framework used (React, Angular, etc). I believe for TS you'll want to import our lib If you search our discussions you'll find others who have left pointers. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Hello everyone ! I've tried to use the model-viewer on react TS project but got the error
./node_modules/@google/model-viewer/dist/model-viewer.js 49514:35
Module parse failed: Unexpected token (49514:35)
File was processed with these loaders:
You may need an additional loader to handle the result of these loaders.
| if (metalnessMap === roughnessMap) return metalnessMap;
| console.warn('THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures.');
| const roughness = roughnessMap?.image;
| const width = Math.max(metalness?.width || 0, roughness?.width || 0);
Unfortunately I could not find any example where the viewer used with TS
Live Demo
https://glitch.com/edit/#!/model-viewer
Version
Beta Was this translation helpful? Give feedback.
All reactions