ashtuchkin / iconv-lite

Convert character encodings in pure javascript.
MIT License
3.08k stars 282 forks source link

Cant build project with iconv-lite #303

Closed g1A2n4f5Uo closed 2 years ago

g1A2n4f5Uo commented 2 years ago

Hello. I'm installing iconv-lite and now I can't build the project using webpack 4. I'm getting errors:

ERROR in ./node_modules/iconv-lite/lib/index.js 5:18-43
Module not found: Error: Can't resolve './bom-handling' in '/Desktop/Projects/MyLib/node_modules/iconv-lite/lib'
 @ ./src/GetData.ts 7:21-42
 @ ./src/LoadData.ts 18:39-79

ERROR in ./node_modules/iconv-lite/lib/index.js 63:26-49
Module not found: Error: Can't resolve '../encodings' in '/Desktop/Projects/MyLib/node_modules/iconv-lite/lib'
 @ ./src/GetData.ts 7:21-42
 @ ./src/LoadData.ts 18:39-79

ERROR in ./node_modules/iconv-lite/lib/index.js 144:18-38
Module not found: Error: Can't resolve './streams' in '/Desktop/Projects/MyLib/node_modules/iconv-lite/lib'
 @ ./src/GetData.ts 7:21-42
 @ ./src/LoadData.ts 18:39-79
g1A2n4f5Uo commented 2 years ago

it's my mistake I forgot add js files in webpack.config.ts.

module.exports = {
  ...
  resolve: {
    extensions: ['.js', '.jsx', '.ts', '.tsx'],
  },
};