jsoneditor-react icon indicating copy to clipboard operation
jsoneditor-react copied to clipboard

Icons are not rendered.

Open rinturj84 opened this issue 5 years ago • 10 comments

Icons are not visible in the editor. Issue reproduced in codesandbx. https://codesandbox.io/s/infallible-smoke-lvcvo?fontsize=14&hidenavigation=1&theme=dark

rinturj84 avatar Feb 28 '20 09:02 rinturj84

do u using CRA ? may be this is relevant to jsoneditor itself.. for webpack build u need appropriated loaders check this issue https://github.com/vankop/jsoneditor-react/issues/16

vankop avatar Feb 28 '20 12:02 vankop

I'm using React in Meteor app. Bundled using using default meteor bundler.

rinturj84 avatar Feb 29 '20 10:02 rinturj84

is there any update regarding this issue ?

rinturj84 avatar Mar 05 '20 09:03 rinturj84

I think it is a problem upstream or in your webpack config.. You could check storybook https://github.com/vankop/jsoneditor-react/tree/master/stories all staff works..

vankop avatar Mar 05 '20 10:03 vankop

In provided example svg with icons loads, so probably you need to create issue in jsoneditor itself https://github.com/josdejong/jsoneditor/issues

vankop avatar Mar 05 '20 10:03 vankop

In provided example svg with icons loads, so probably you need to create issue in jsoneditor itself https://github.com/josdejong/jsoneditor/issues

I cant see icons loaded in provided example too, neither in my app https://codesandbox.io/s/infallible-smoke-lvcvo?fontsize=14&hidenavigation=1&theme=dark Screenshot 2020-12-17 at 16 36 24

TrejGun avatar Dec 17 '20 13:12 TrejGun

Working to find a fix for this. Its one of those straight forward gotchas, must be

TheGitPanda avatar Apr 13 '22 23:04 TheGitPanda

So it is indeed a webpack configuration issue. In my case I was using image-webpack-loader. But as soon as I changed my webpack config to use the following (begrudgingly), svgs and images are now loaded. Also ensure your Sass config is using resolve-url-loader and source map is enabled.

{
    test: /\.(png|jpg|gif|svg)$/,
    type: 'asset/resource',
}

TheGitPanda avatar Apr 20 '22 22:04 TheGitPanda

I removed the config from webpack config from module.rules, and it worked Looks like the css loader toke care of it. { test: /\.css$/, use: ['style-loader', 'css-loader'] }

ypling avatar May 18 '22 23:05 ypling