Comments (5)
I also tested it with a React app (create-react-app). The setup worked fine, and the errors that prevented me from opening the Next app were just warnings while I was compiling. But when I tried to load the model with the IFCLoader, the following error appeared (the following images are the part of the code that resulted in the error, the compiling warnings and the error in the website console):
from web-ifc-three.
I am using the following post-install script as a workaround to avoid build issues in my angular application.
`const fs = require('fs');
const path = require('path');
const filePath = path.join(__dirname, 'node_modules/.pnpm/[email protected][email protected]/node_modules/web-ifc-three/IFCLoader.js');
let fileContent = fs.readFileSync(filePath, 'utf8');
fileContent = fileContent.replace(
"from 'three/examples/jsm/utils/BufferGeometryUtils'",
"from 'three/examples/jsm/utils/BufferGeometryUtils.js'"
);
fs.writeFileSync(filePath, fileContent);`
from web-ifc-three.
There is a workaround is in the discord server: https://discord.com/channels/799990228336115742/1091078047228235877
Just need to transpile packages
from web-ifc-three.
I think the package.json for web-ifc-three is wrong.
web-ifc-three refers to an ESM named IFCLoader.js in the "main" property of package.json.
However, according to the Node.js specification, if you want the file to be loaded as an ESM, the extension must be .mjs or the value of the "type" field must be "module".
web-ifc-three satisfies neither of these requirements.
Therefore, Next.js is mistakenly reading web-ifc-three as CommonJS.
from web-ifc-three.
As a further problem, I tried rewriting the web-ifc-three's package.json to reference the IFCLoader.umd.cjs included with web-ifc-three in the "main" property, but this UMD is trying to load an ESM 'three/examples/jsm/utils/BufferGeometryUtils'
(By the way, this can't solved without the .js extension, so I actually changed it to 'three/examples/jsm/utils/BufferGeometryUtils.js'
.) with require
, which also results in an error.
from web-ifc-three.
Related Issues (20)
- https://ifcjs.io/ HOT 3
- IFCWorker.js.15776 report an error HOT 3
- RuntimeError: abort(LinkError: WebAssembly.instantiate(): HOT 4
- SyntaxError: Cannot use import statement outside a module HOT 1
- Lifecycle script `build` failed with error: Error: command failed in workspace: [email protected] HOT 2
- Error loading IFC wasmModule.OpenModel is not a function HOT 9
- bump three.js version to 152.1 HOT 1
- Can't get TypeName with IFCWorker
- Load a local ifc file, but nothing shows on the website HOT 1
- Can't hide/show only one type of object
- non-empty segments in IFCINDEXEDPOLYCURVE currently not supported HOT 3
- Error: 'package.json' is not defiend by "exports" HOT 1
- No basis found for brep!
- Cant load a IFC File HOT 1
- THREE.WebGLRenderer: Error creating WebGL context.
- error with ifcloader
- I would like to see the latest version released to support the latest web-ifc
- Very simple code with react fiber HOT 1
- Trouble Highlighting IFCOPENINGELEMENTs in three.js 3D View HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web-ifc-three.