-
Notifications
You must be signed in to change notification settings - Fork 138
Description
Issue
I recently updated web-ifc-three to the latest version hoping to resolve this critical dependency warning without luck:
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
@ ./node_modules/web-ifc-three/IFCLoader.js 1:0-34 2:0-233 112:7-15 113:7-24 188:68-93 661:10-26 667:10-43 673:10-35 679:10-34 685:10-29 812:70-80 883:62-72 1099:74-85 1964:7-15 1965:7-24 2386:15-28 2462:27-40 2598:27-40
Delving deeper, I discovered that the issue originates from web-ifc. There are already two issues on the web-ifc repository discussing this problem, and it was resolved in May 2023 with version 0.0.41.
- Issue #376 where the critical dependency was addressed.
- Issue #493 discussing the warning in the context of
web-ifc-three, pointing out that it still uses an old version ofweb-ifc.
After some investigation, I found that both [email protected] and [email protected] from the Node Package Manager still rely on web-ifc@^0.0.39, which causes the critical dependency warning.
Here on the web-ifc-three GitHub repository, the package-lock.json for the main branch (version 0.0.125) specifies:
"node_modules/web-ifc": {
"version": "0.0.41",
"resolved": "https://registry.npmjs.org/web-ifc/-/web-ifc-0.0.41.tgz",
"integrity": "sha512-rSucJcwWDw6jrfxPu77jVcpCU6otMd3qWYsH+6L3nr5jJVr4S1O5rAZfkKNlpBM5m0mDvSHU3DzXm9SXfGqBkw=="
}Steps Taken to Resolve the Issue:
I tried various tricks with npm, but I wasn't able to override web-ifc version 0.0.39.
Finally, I resolved the critical dependency warnings by forcing web-ifc version 0.0.41 through modifying my package-lock.json. Here are the steps I took:
- Start with a clean
package.json:{ "name": "your-project-name", "version": "1.0.0", "dependencies": { "web-ifc-three": "0.0.125" } } - Remove existing
node_modulesandpackage-lock.json:rm -rf node_modules package-lock.json
- Run
npm install:npm install
- Install [email protected] to obtain the "resolved" and "integrity" values. Then uninstall it and repeated steps 2 and 3:
npm install [email protected] --save npm uninstall web-ifc
- Open
package-lock.jsonand manually update all occurrences ofweb-ifcto version0.0.41:"web-ifc": { "version": "0.0.41", "resolved": "https://registry.npmjs.org/web-ifc/-/web-ifc-0.0.41.tgz", "integrity": "sha512-..." }
- Reinstall dependencies:
npm install
Request
Could you update the web-ifc dependency in web-ifc-three to ^0.0.41 in the npm package?