Closed lukinoe closed 3 months ago
Code executed:
const WebIFC = require("web-ifc/web-ifc-api");
// initialize the API const ifcApi = new WebIFC.IfcAPI();
// initialize the library ifcApi.Init();
// Read the IFC file fs.readFile(ifcFilePath, 'utf8', (err, data) => { if (err) { console.error('Error reading the file:', err); return; }
// Parse the IFC data const modelID = ifcAPI.OpenModel(data);
// Extract hierarchy const hierarchy = extractHierarchy(modelID);
console.log(hierarchy);
// Close the model to free resources ifcAPI.CloseModel(modelID); });
hi @lukinoe try "node --no-experimental-fetch src/server.js"
hi @RyugaRyuzaki, why is that necessary?
I think the standard example code from the tutorial in a plain new project should be working ...
also "node --no-experimental-fetch src/server.js" is not working for me
it worked by calling:
const WebIFC = require("web-ifc");
instead of const WebIFC = require("web-ifc/web-ifc-api");
in node.
What happened?
It seems that the "web-ifc" package is attempting to access the "web-ifc-api" subpath, but this subpath is not defined in the "exports" field of the "web-ifc" package's package.json file.
Version
0.0.54
What browsers are you seeing the problem on?
No response
Relevant log output
Anything else?
The error occurs when starting a clean new project when calling import.
node.js: v. 16.17.0 Windows Operating System