react-json-view
react-json-view copied to clipboard
Theme imports don't work
Pretty straightforward issue. 2.0.0-alpha.17
@suhjohn Upgrade v2.0.0-alpha.18
@uiw/react-json-view: ^2.0.0-alpha.24
error: Error: Unable to resolve module @uiw/react-json-view/light
@ductridev It seems to be working.
Just need to run npm i @uiw/react-json-view right?
@ductridev npm i @uiw/[email protected]
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 I can't assist you as I can't reproduce your error.
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 You can provide me with an example that reproduces the error, and I can take a look at it for you.
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.