---
title: "Comment by Matimu Ignatius on \"How I made a gasless NFT drop with Javascript only\" | Hashnode"
description: "Hello Azim Ahmed Great article... How do I resolve the error below? Unhandled Runtime Error TypeError: Cannot read properties of undefined (reading &#39;toHexSt"
url: "https://hashnode.com/posts/how-i-made-a-gasless-nft-drop-with-javascript-only/61f7213400273a7c1776c6f1/comment/6228a1e233120280724e95c0"
---

[Discussion](https://hashnode.com/posts/how-i-made-a-gasless-nft-drop-with-javascript-only/61f7213400273a7c1776c6f1)

Comment [How I made a gasless NFT drop with Javascript only](https://hashnode.com/posts/how-i-made-a-gasless-nft-drop-with-javascript-only/61f7213400273a7c1776c6f1)

[Matimu Ignatius](https://hashnode.com/@Matimu)

[Mar 9, 2022](https://hashnode.com/posts/how-i-made-a-gasless-nft-drop-with-javascript-only/61f7213400273a7c1776c6f1/comment/6228a1e233120280724e95c0)

Hello [Azim Ahmed](https://hashnode.com/@ximxim) Great article...

How do I resolve the error below?

Unhandled Runtime Error TypeError: Cannot read properties of undefined (reading 'toHexString')

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1646830042327/jxxCfnSAx.png)

[Azim Ahmed](https://hashnode.com/@ximxim)

[Mar 9, 2022](https://hashnode.com/posts/how-i-made-a-gasless-nft-drop-with-javascript-only/61f7213400273a7c1776c6f1/comment/6228a1e233120280724e95c0#reply-6228ac3467104e8316e40d80)

Seems like you don't have private key environment variable in your .env.local file. You want to add that file and set that variable.

[Matimu Ignatius](https://hashnode.com/@Matimu)

[Mar 9, 2022](https://hashnode.com/posts/how-i-made-a-gasless-nft-drop-with-javascript-only/61f7213400273a7c1776c6f1/comment/6228a1e233120280724e95c0#reply-6228ad5633120280724e9779)

[Azim Ahmed](https://hashnode.com/@ximxim) Thank you for your reply.

I did set it up still getting same error

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1646832945218/eTy7z5k9F.png)

[Azim Ahmed](https://hashnode.com/@ximxim)

[Mar 9, 2022](https://hashnode.com/posts/how-i-made-a-gasless-nft-drop-with-javascript-only/61f7213400273a7c1776c6f1/comment/6228a1e233120280724e95c0#reply-6228dc7067104e8316e416ef)

[Matimu Ignatius](https://hashnode.com/@Matimu) Ah next for some reason doesn't let you put variable names without a prepend NEXT\_PUBLIC. So you should probably rename your env variable to NEXT\_PUBLIC\_PRIVATE\_KEY in all the places.

[Matimu Ignatius](https://hashnode.com/@Matimu)

[Mar 9, 2022](https://hashnode.com/posts/how-i-made-a-gasless-nft-drop-with-javascript-only/61f7213400273a7c1776c6f1/comment/6228a1e233120280724e95c0#reply-6228e3ff33120280724ea17d)

[Azim Ahmed](https://hashnode.com/@ximxim) I renamed crossing my fingers it works but new server error.

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1646846711132/5eyNBheiJ.png)

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1646846767133/njTLaSTbz.png)

[Matimu Ignatius](https://hashnode.com/@Matimu)

[Mar 9, 2022](https://hashnode.com/posts/how-i-made-a-gasless-nft-drop-with-javascript-only/61f7213400273a7c1776c6f1/comment/6228a1e233120280724e95c0#reply-6228ee0e019447953617d897)

[Azim Ahmed](https://hashnode.com/@ximxim) I attempted

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1646849370008/6Y9YnmOBd.png)

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1646849408164/s_tSxnE4z.png)

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1646849485172/vxOdy-t2E6.png)

Resluted to this error

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1646849544688/s-N_GQxnA.png)
