xeokit-sdk icon indicating copy to clipboard operation
xeokit-sdk copied to clipboard

React integration glitch - Module not found: Error: Can't resolve 'asciify-image'

Open KuNman opened this issue 2 years ago • 2 comments

Describe the bug I can not use .xkt V10 as it's supported by xeokit-sdk: ^2.1.0 which breaks in build.

To Reproduce

  1. Create CRA app.
  2. Install @xeokit/xeokit-sdk": "2.3.0-beta-33.
  3. Run npm run build.

Screenshots Screenshot 2022-08-11 at 16 47 33

Desktop:

  • OS: macOS Ventura

KuNman avatar Aug 11 '22 14:08 KuNman

I just Googled "CRA" and found "Create React Application", so I'm assuming this is an issue with ReactJS integration. I just updated the title accordingly.

unfortunately we're limited in how much support we can offer for integration with 3rd-party application frameworks - the best we can do is try to follow best practices in xeokit SDK, and hope the frameworks follow them also.

I'll tag this as "help wanted" in case anyone with React expertise has a PR workaround.

xeolabs avatar Aug 23 '22 14:08 xeolabs

in Vue2 I've added the following to my vue.config.js file:

+ const webpack = require('webpack');

module.exports = {
  configureWebpack: {
+    plugins: [
+      new webpack.IgnorePlugin({
+        resourceRegExp: /asciify-image/,
+      })
+    ]
  },
}

maybe the same is possible for React

mlankamp avatar Sep 12 '22 13:09 mlankamp