cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

Dropbox Sign API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can't resolve './aes' error when using @dropbox/sign

Can't resolve './aes' error when using @dropbox/sign

sara81
Helpful | Level 5

Node: 18.17.1

@dropbox/sign: 1.1.3

 

Hi,

 

when I try to use the sdk I get the following error:


- error ./node_modules/@dropbox/sign/dist/api.js
Module not found: Can't resolve './aes'

The error comes from this simple piece of code:

 

import * as DropboxSign from '@dropbox/sign';

const signatureRequestApi = new DropboxSign.SignatureRequestApi();

 

Would be very greatful for any help on this.

 

Best,

S

10 Replies 10

DB-Des
Dropbox Engineer

Hi there,

 

Just a few questions, for you:

  • Did you install the DropboxSign API using npm?
  • Are you using a front-end library, such as React? 
  • Are you using a framework such as Vue or NextJS?

 

sara81
Helpful | Level 5

Hi, 

 

to answer your questions.
1) I am using npm 9.6.7
2) I'm triggering this code from an api route in Next.js.

3) I'm using Next.js 13.4.19

FYI: I got the same behavior using node 20 as 18.

DB-Des
Dropbox Engineer

Hello,

 

The reason you are seeing that error is because the Dropbox Sign Node SDK uses Node.js specific modules, or modules that are not available on the client side.

 

You can address that issue by looking into NextJS' getStaticProps, getStaticPaths or getServerSideProps functions.

 

References:

 

Hope this helps!

reef878
Explorer | Level 4

this doesn't solve the problem--i'm hitting the exact same issue & i've reviewed all the referenced documentation. is there possibly an issue with the package itself?

DB-Des
Dropbox Engineer

Hi,

 

We have not received any reported issues from developers who have been using the Node SDK since its official release.

 

You can reach out to our support team with more details, including code snippets, for your integration to see if we can figure out where the error is coming from.

reef878
Explorer | Level 4

thank you for the response! i created this github issue and am hoping it helps myself & anyone else who might be facing this issue with the package.

Juan - Dropbox
Dropbox Staff

Hi there. I've created an example repo for anyone using Next.js + the Sign Node SDK: https://github.com/hellosign/nextjs-blog

 

The trick is next.config.js must ignore fs and axios on client-side rendering.

Make sure to invoke the SDK package only within getStaticProps or getServerSideProps functions.

 

Unfortunately per my response in this GitHub issue I don't know Next.js well enough to figure out how to make the above work when using its App Router - so the solution will only apply if you are not using it.

reef878
Explorer | Level 4

this is very helpful, thank you! i'll use the method you've proposed for now.

sara81
Helpful | Level 5

Have your team created an issue for Next.js that I can follow?

 

Thanks for the workaround! I think I can make it work for now but would be great to remove the workaround/hack at some point of time.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    DB-Des Dropbox Engineer
  • User avatar
    sara81 Helpful | Level 5
  • User avatar
    reef878 Explorer | Level 4
  • User avatar
    Juan - Dropbox Dropbox Staff
What do Dropbox user levels mean?