react-json-view icon indicating copy to clipboard operation
react-json-view copied to clipboard

Theme imports don't work

Open suhjohn opened this issue 1 year ago • 10 comments

Screenshot 2024-03-10 at 12 01 46 AM Screenshot 2024-03-10 at 12 01 53 AM

Pretty straightforward issue. 2.0.0-alpha.17

suhjohn avatar Mar 10 '24 08:03 suhjohn

@suhjohn Upgrade v2.0.0-alpha.18

jaywcjlove avatar Mar 10 '24 09:03 jaywcjlove

@uiw/react-json-view: ^2.0.0-alpha.24 error: Error: Unable to resolve module @uiw/react-json-view/light

ductridev avatar Apr 23 '24 03:04 ductridev

image

@ductridev It seems to be working.

image

jaywcjlove avatar Apr 23 '24 05:04 jaywcjlove

Just need to run npm i @uiw/react-json-view right?

ductridev avatar Apr 23 '24 08:04 ductridev

@ductridev npm i @uiw/[email protected]

jaywcjlove avatar Apr 23 '24 08:04 jaywcjlove

Ah, still same even file exists.

error: Error: Unable to resolve module @uiw/react-json-view/light from G:\Android\xxx\src\screens\Tab.tsx: @uiw/react-json-view/light could not be found within the project or in these directories:
  node_modules
  11 | import JsonView from '@uiw/react-json-view';
> 12 | import { lightTheme } from '@uiw/react-json-view/light';

ductridev avatar Apr 23 '24 08:04 ductridev

@ductridev I can't assist you as I can't reproduce your error.

jaywcjlove avatar Apr 23 '24 08:04 jaywcjlove

What versions of React are you guys using? @jaywcjlove @ductridev I wonder if one is on 18 and one on 17? Perhaps that why @jaywcjlove wasn't able to repro the issue?

I'm on 17 and I'm getting that same lightTheme error on 2.0.0-alpha.26 🤔

jrodden1 avatar Aug 23 '24 19:08 jrodden1

@jrodden1 You can provide me with an example that reproduces the error, and I can take a look at it for you.

jaywcjlove avatar Aug 24 '24 02:08 jaywcjlove

From Chatgpt:

// vite.config.js
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

export default defineConfig({
  plugins: [react()],
  optimizeDeps: {
    include: ['@uiw/react-json-view'],
  },
});

This helped me.

b4hdr avatar Dec 16 '24 07:12 b4hdr