Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack modules not resolving #232

Open
callumcox opened this issue Nov 10, 2020 · 5 comments
Open

Webpack modules not resolving #232

callumcox opened this issue Nov 10, 2020 · 5 comments

Comments

@callumcox
Copy link

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 #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:

webpack/webpack#906
swagger-api/swagger-codegen#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!

@EdwinMoralesDS
Copy link

EdwinMoralesDS commented Dec 1, 2020

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

@thiwanka-aux
Copy link

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

@jimmyn
Copy link

jimmyn commented Dec 16, 2021

I'm having the same issue

@noah10
Copy link

noah10 commented Mar 10, 2022

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

noah10 added a commit to EmotionCognitionLab/pvs that referenced this issue Mar 11, 2022
Modifies lambda webpack config to deal with:
docusign/docusign-esign-node-client#232
@yaniv691
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants