Giter Club home page Giter Club logo

Comments (5)

gabrielwebphy avatar gabrielwebphy commented on June 26, 2024 1

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):
image
image
image

from web-ifc-three.

antonyadhiban avatar antonyadhiban commented on June 26, 2024 1

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.

sinedie avatar sinedie commented on June 26, 2024

There is a workaround is in the discord server: https://discord.com/channels/799990228336115742/1091078047228235877

Just need to transpile packages

from web-ifc-three.

yukiyokotani avatar yukiyokotani commented on June 26, 2024

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.

yukiyokotani avatar yukiyokotani commented on June 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.