docusign-esign-node-client icon indicating copy to clipboard operation
docusign-esign-node-client copied to clipboard

Webpack modules not resolving

Open callumcox opened this issue 4 years ago • 5 comments

Hi,

We're using webpack, to minimize the size of the lambda we've got that consume the DocuSign client and I've had the same problem as https://github.com/docusign/docusign-node-client/issues/214. Digging into the src, looks like it's down to the AMD module resolution and the lack of preceding ./ in the require paths. Once I updated the modules in index.js with ./, these began resolving (until it encountered other imports in the models):

An example of the error is below:

ERROR in ../../node_modules/docusign-esign/src/model/Zip.js
Module not found: Error: Can't resolve 'model/SmartContractInformation' in '/app/node_modules/docusign-esign/src/model'
@ ../../node_modules/docusign-esign/src/index.js

I dug around and found the following:

https://github.com/webpack/webpack/issues/906 https://github.com/swagger-api/swagger-codegen/issues/3336 https://webpack.js.org/loaders/imports-loader/

I've worked around it by installing imports-loader and adding the following into my webpack config:

{
  test: /docusign-esign\/.*\.js$/,
  use: {
    loader: 'imports-loader',
    options: {
      additionalCode: 'var define = false; /* Disable AMD for misbehaving libraries */',
    },
  },
},

Can the paths be updated to include the relative portion so the workaround isn't needed?

Thanks!

callumcox avatar Nov 10 '20 15:11 callumcox

Internal SDK bug DCM-5025 has been filed. Thank you for the report.

EdwinMoralesDS avatar Dec 01 '20 12:12 EdwinMoralesDS

I'm still getting webpack error when building docusign-esign module. I tried that work around but didint work. Please let me know other options

thiwanka-aux avatar Sep 14 '21 12:09 thiwanka-aux

I'm having the same issue

jimmyn avatar Dec 16 '21 11:12 jimmyn

I'm having this issue as well. @EdwinMoralesDS , could you please provide a status update on internal SDK bug DCM-5025?

noah10 avatar Mar 10 '22 23:03 noah10

This issue is still happening more than a year after the last comment in the thread. @callumcox's suggestions work, but it's "hacky" due to other config changes needed to be made in order for everything to play nice. Any other, cleaner suggestions?

yaniv691 avatar Jul 24 '23 08:07 yaniv691