Make sure the Vega editor with Vite works with linked Vega and Vega-Lite packages
Developers, for now, roll back to a pre-vote version: 53b8515f8adef9fb2aa3b578c8ff7275ddd15969
@domoritz Hi there! I've tried using https://github.com/vega/editor/commit/53b8515f8adef9fb2aa3b578c8ff7275ddd15969 but get another error:
cheliu@RJFYQ0Y7WX editor % yarn start yarn run v1.22.19 $ webpack serve --mode development [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:8080/ [webpack-dev-server] On Your Network (IPv4): http://172.16.7.47:8080/ [webpack-dev-server] On Your Network (IPv6): http://[fe80::1]:8080/ [webpack-dev-server] Content not from webpack is served from '/Users/cheliu/editor/public' directory Browserslist: caniuse-lite is outdated. Please run: npx update-browserslist-db@latest Why you should do it regularly: https://github.com/browserslist/update-db#readme ERROR in ./src/components/app.tsx 9:0-33 Module not found: Error: Can't resolve 'vega-lite' in '/Users/cheliu/editor/src/components' @ ./src/components/app-shell.tsx 3:0-24 9:80-83 11:73-76 12:98-101 13:103-106 14:95-98 15:95-98 16:107-110 17:101-104 18:79-82 19:88-91 @ ./src/index.tsx 8:0-46 22:28-36
ERROR in ./src/components/config-editor/config-editor-header.tsx 5:0-33 Module not found: Error: Can't resolve 'vega-lite' in '/Users/cheliu/editor/src/components/config-editor' @ ./src/components/input-panel/spec-editor-header/index.tsx 7:0-74 27:79-97 @ ./src/components/input-panel/index.tsx 12:0-52 35:36-52 @ ./src/components/app.tsx 15:0-39 142:40-50 @ ./src/components/app-shell.tsx 3:0-24 9:80-83 11:73-76 12:98-101 13:103-106 14:95-98 15:95-98 16:107-110 17:101-104 18:79-82 19:88-91 @ ./src/index.tsx 8:0-46 22:28-36
ERROR in ./src/components/header/export-modal/renderer.tsx 8:0-50 Module not found: Error: Can't resolve 'vega-lite' in '/Users/cheliu/editor/src/components/header/export-modal' @ ./src/components/header/export-modal/index.tsx 2:0-34 14:40-48 @ ./src/components/header/renderer.tsx 11:0-47 222:50-61 @ ./src/components/header/index.tsx 4:0-34 37:71-79 @ ./src/components/app.tsx 14:0-30 137:32-38 @ ./src/components/app-shell.tsx 3:0-24 9:80-83 11:73-76 12:98-101 13:103-106 14:95-98 15:95-98 16:107-110 17:101-104 18:79-82 19:88-91 @ ./src/index.tsx 8:0-46 22:28-36
ERROR in ./src/components/header/help-modal/index.tsx 4:0-50 Module not found: Error: Can't resolve 'vega-lite' in '/Users/cheliu/editor/src/components/header/help-modal' @ ./src/components/header/renderer.tsx 13:0-43 301:56-65 @ ./src/components/header/index.tsx 4:0-34 37:71-79 @ ./src/components/app.tsx 14:0-30 137:32-38 @ ./src/components/app-shell.tsx 3:0-24 9:80-83 11:73-76 12:98-101 13:103-106 14:95-98 15:95-98 16:107-110 17:101-104 18:79-82 19:88-91 @ ./src/index.tsx 8:0-46 22:28-36
ERROR in ./src/components/renderer/renderer.tsx 7:0-38 Module not found: Error: Can't resolve 'vega-lite' in '/Users/cheliu/editor/src/components/renderer' @ ./src/components/renderer/index.tsx 6:0-34 31:60-68 @ ./src/components/viz-pane/renderer.tsx 7:0-35 94:36-44 @ ./src/components/viz-pane/index.tsx 4:0-34 30:60-68 @ ./src/components/app.tsx 17:0-33 143:40-47 @ ./src/components/app-shell.tsx 3:0-24 9:80-83 11:73-76 12:98-101 13:103-106 14:95-98 15:95-98 16:107-110 17:101-104 18:79-82 19:88-91 @ ./src/index.tsx 8:0-46 22:28-36
ERROR in ./src/components/viz-pane/renderer.tsx 12:0-50 Module not found: Error: Can't resolve 'vega-lite' in '/Users/cheliu/editor/src/components/viz-pane' @ ./src/components/viz-pane/index.tsx 4:0-34 30:60-68 @ ./src/components/app.tsx 17:0-33 143:40-47 @ ./src/components/app-shell.tsx 3:0-24 9:80-83 11:73-76 12:98-101 13:103-106 14:95-98 15:95-98 16:107-110 17:101-104 18:79-82 19:88-91 @ ./src/index.tsx 8:0-46 22:28-36
ERROR in ./src/index.tsx 6:0-38 Module not found: Error: Can't resolve 'vega-lite' in '/Users/cheliu/editor/src'
ERROR in ./src/reducers/index.ts 4:0-38 Module not found: Error: Can't resolve 'vega-lite' in '/Users/cheliu/editor/src/reducers' @ ./src/store/configure-store.ts 4:0-38 28:30-41 30:41-33:9 30:8-33:10 31:36-66 @ ./src/index.tsx 9:0-53 17:21-35
ERROR in ./src/utils/monaco.ts 4:0-38 Module not found: Error: Can't resolve 'vega-lite' in '/Users/cheliu/editor/src/utils' @ ./src/index.tsx 7:0-41 16:0-11
ERROR in ./node_modules/vega-embed/build/vega-embed.module.js 6:0-44 Module not found: Error: Can't resolve 'vega-lite' in '/Users/cheliu/editor/node_modules/vega-embed/build' @ ./src/constants/default-state.ts 1:0-34 4:475-484 @ ./src/store/configure-store.ts 6:0-61 7:54-67 13:30-43 @ ./src/index.tsx 9:0-53 17:21-35
webpack compiled with 10 errors
I'm not sure if I should link vega in addition to vega-lite. But I cannot link it actually:
cheliu@RJFYQ0Y7WX vega % yarn link yarn link v1.22.19 error Couldn't find package name. info Visit https://yarnpkg.com/en/docs/cli/link for documentation about this command.
@domoritz I guess this is still yarn link issue, appreciate it if you could give some suggestions. Thanks.
Ok I thought something is wrong with my computer. lol
I think we are running into https://github.com/vitejs/vite/issues/8619. I got it mostly working but you need to save your Vite config file right now. The plus is that you don't even need to rebuild or watch Vega-Lite anymore.