prowritingaid.javascript icon indicating copy to clipboard operation
prowritingaid.javascript copied to clipboard

Webpack not resolving the correct path

Open me12722 opened this issue 7 years ago • 2 comments

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?

me12722 avatar Apr 06 '18 00:04 me12722

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'

ToddGore avatar Oct 27 '18 17:10 ToddGore

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'
        }
    ]
}

devkdouglass avatar Apr 27 '20 21:04 devkdouglass