-
Notifications
You must be signed in to change notification settings - Fork 100
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
Module not found: Can't resolve 'ApiClient' in '\node_modules\docusign-esign\src' When running SERVER-SIDE #332
Comments
I guess the docusign-esign package was damaged so the src/ApiClient file no longer exists. Could you please remove the current package and reinstall the latest version in your application? |
I've confirmed that I'm on the latest version 6.3.0 and the src/ApiClient file exists in node_modules |
Based on my knowledge, NextJS is used as a Frontend framework, not a server-side. I found this post that addresses this issue on NextJS official page: https://nextjs.org/docs/messages/module-not-found#the-module-youre-trying-to-import-is-not-installed-in-your-dependencies Hope this helps! |
Getting the same issue here using next 14. Did you manage to get it work ? I can confirm that nextjs has the ability the define backend api routes with a nodejs runtime. |
I'm using Next and I'm getting this same exact error when migrating from the pages router to the app router. I tried this on Next 13 and Next 14 and encountered the same issue on both. I tried to solve this by fiddling with webpack resolver aliases: (https://webpack.js.org/configuration/resolve/#resolvealias), and was able to make the error change to |
I think that the issue might come from these lines of code: docusign-esign-node-client/src/index.js Lines 11 to 18 in e54536a
I'm not really sure, but I think that in the pages router the |
@sjkcodes @romariclaurent I was able to fix this by adding the following to the module.exports = {
...
experimental: {
serverComponentsExternalPackages: ['docusign-esign'],
},
} Unfortunately, now I'm getting other errors that are preventing me from migrating to the app router, but might fix your problem! |
Same issue here with Next.js 14 using pages router. |
As @nicolassanmar added in Nov 7th answer |
I followed what nicolassanmar said above:
And also had "other errors" -- namely, when running
to
fixed it and got my code compiling, as renanadstest suggested above. |
Thanks, @nicolassanmar, for providing a solution here! I really appreciate your help in resolving this issue for our SDK users. @sjkcodes @romariclaurent, can you please confirm if you've been able to resolve the issue you were facing, or are you still encountering problems? |
@sonawane-sanket I am no longer facing issues after adding the above. However, at the very least, I think documentation should be updated to reflect this limitation. This solution was difficult to track down, and without finding it, I would not have been able to use DocuSign with NextJS. |
I am facing this issue as well, can the documentation be updated to help us understand how to write a NextJS API route that uses docusign-esign? This is still unclear to me |
HI there,
I'm getting
Module not found: Can't resolve 'ApiClient' in '\node_modules\docusign-esign\src'
from my API route.I see that this error is normally associated with users trying to run the client from the browser, but my code is definitely server-side.
I'm using NextJS 13.
Anyone else encountering this issue?
The text was updated successfully, but these errors were encountered: