Webpack not resolving the correct path
I installed the pakage using 'yarn add pro_writing_aid_api' but when I import it I get the error message 'Uncaught Error: Cannot find module "ApiClient" at webpackMissingModule'
Is there anything I can do to work around this? has anyone else arrived at this issue?
I'm having the same issue as me12722 above. I've tried npm and github install but get: ./node_modules/pro_writing_aid_api/src/index.js Module not found: Can't resolve 'ApiClient' in '/Users/toddgore/Desktop/CUSTOMERS/ReactTest/mytest/node_modules/pro_writing_aid_api/src'
You'll need to adjust Webpack's configuration to resolve the dependency issue.
Related Issues https://github.com/swagger-api/swagger-codegen/issues/3336 https://medium.com/webpack/how-to-cope-with-broken-modules-in-webpack-4c0427fb23a
Steps to resolve
- Add Imports Loader -- https://webpack.js.org/loaders/imports-loader/ -- https://github.com/webpack-contrib/imports-loader#install
- Configure webpack
module: {
rules: [
{
test: /pro_writing_aid_api\/.*\.js$/,
use: 'imports-loader?define=>false'
}
]
}