Open ruisheng95 opened 11 months ago
not working with vite
Same thing with React Native web
this helped me make friends with vite and react-windowed-select
add this to vite.config.ts
export default defineConfig({
....
resolve: {
alias: {
'react-windowed-select': 'react-windowed-select/dist/main.js',
},
},
...
}
Hello, on
react-windowed-select
version 5.1.1 running with Vite, it will encounter an error ofFailed to resolve entry for package "react-windowed-select". The package may have incorrect main/module/exports specified in its package.json.
. It seems that the changes in #116 is referring a nonexistent file ofdist/index.js
I tried replacing the
module
field insidepackage.json
todist/main.js
and it seem to fix the error. Though I wasn't sure is this the right way of fixing it, as my knowledge on Javascript bundling is minimal.Here is a demo of the error.