pupudu / window-table

Windowing Table for React based on React Window
https://window-table.netlify.com/
170 stars 13 forks source link

lodash-es dependencies are required to install #33

Closed erik4github closed 4 years ago

erik4github commented 4 years ago

If using npm install window-table --save , the lodash dependencies aren't installed with. So when using webpack-dev-server to build, you'll run into:

ERROR in ./node_modules/window-table/dist/window-table.esm.js
Module not found: Error: Can't resolve 'lodash-es/debounce' in 'C:\...path\node_modules\window-table\dist'
 @ ./node_modules/window-table/dist/window-table.esm.js 3:0-42 428:11-19 801:11-19
 @ ./src/app.js
 @ ./src/index.js

ERROR in ./node_modules/window-table/dist/window-table.esm.js
Module not found: Error: Can't resolve 'lodash-es/isEqual' in 'C:\...path\node_modules\window-table\dist'
 @ ./node_modules/window-table/dist/window-table.esm.js 4:0-40 414:9-16
 @ ./src/app.js
 @ ./src/index.js

If I install the lodash-es libraries, project builds fine.

Not sure if it's more appropriate to mark them as dependencies rather than peer dependencies, or just make a note in the documentation when installing via npm.

pupudu commented 4 years ago

Hi @erik4github Thanks for reporting this issue. Yes, we should make it a dependency. Will do that as soon as I get some time.

pupudu commented 4 years ago

Hi @erik4github What's the window-table version you tried? Because I just noticed that we are no longer using lodash-es.

Thanks

pupudu commented 4 years ago

Just published v0.10.3 with @types/lodash-es replaced with @types/lodash. That may have been the issue for you. Please let us know if 0.10.3 fixes the issue for you. Thanks.

pupudu commented 4 years ago

Just found the issue. Tsdx is transforming lodash usages to lodash-es usages, obviously, for reducing the bundle size. I just added lodash-es to fix that problem. Please install v0.10.4

Ref: https://github.com/jaredpalmer/tsdx#using-lodash

Cheers