TypeError: Cannot read properties of undefined (reading '_bn')
I trying to debug why I get the above error when running my nodejs express server in railway.
The full error:
It has something to do wih the @solana/web3.js package and some fixes suggested here (https://solana.stackexchange.com/questions/4077/bigint-failed-to-load-bindings-pure-js-will-be-used-try-npm-run-rebuild-whe) did not work.
project-id: 060de268-5246-4c9c-b27e-dfaaf4e8fecc
Everything is running fine locally.
Solana Stack Exchange
bigint: Failed to load bindings, pure JS will be used (try npm run ...
When attempting to import Connection from @solana/web3.js, this appears when it is run:
bigint: Failed to load bindings, pure JS will be used (try npm run rebuild?)
It appears to still run, but I am
34 Replies
Project ID:
060de268-5246-4c9c-b27e-dfaaf4e8fecc
forgive me for asking, but you have ran
npm run rebuild
right?I have, yes.
I have also ran
yarn cache clean
still no changeyou've totally removed node_modules as well?
yes
I noticed that you are using railway run, are you aware that only runs the given command locally?
no π
I was under the impression that railway run, runs the command in the deployment environment
for this you wouldn't need railway run, just run the commands locally and push the changes
:rip:
there are no changes to my repo if I run any of the mentioned 3 cmds
nope, there's no way to do that, and for this there's no need to do that, check out the --help printout for more information
so I have nothing to push
make sure you delete all the would be effected files before running those commands
I'm not sure I understand.
I see a lot of "cached" when trying to
railway up
is there a command to make railway build fresh?are you building with nixpacks?
yes
can't hurt to try, set a service variable
NIXPACKS_NO_CACHE
to 1
I have a feeling I'm not doing it right
this is my
railway.toml
filea service variable https://docs.railway.app/guides/variables#service-variables
gotcha
nope, no change
build seem to be fresh
didnt think this was a cache issue, what node version are you using locally, and what node version is railway building your app with
locally:
and from what I can tell railway is using 18 also?
im out of ideas, have you tried googling for the error?
TypeError: Cannot read properties of undefined (reading '_bn')
found this, i dont know your project so i dont know if its applicable though https://stackoverflow.com/questions/70235249/solana-candy-machine-typeerror-cannot-read-properties-of-undefined-reading-byeah, I was reading the exact thing, let me try a thing or 2
thank you for your help π
I was missing an env var ...
makes sense given you might not have known about the service variables
no, I had all my vars in place, (got confused about the term - "service variables") but with one update, locally I introduced a new env var that I forgot to add in in railway
thanks again for help
it literraly bugged me for half a day :rip:
they're called service variables because it's a service and those are the services variables
now I know :respect:
glad its working!
once again, thank you for taking the time to help me
no problem! π
hey @_danielpavel, I am having a similar issue, what var exactly you forgot? the no cache one?
Well, Iβm not sure how my particular case helps you. You have to check your code and see which one youβve missed and used assuming itβs holds a value comming from your env but itβs actually undefined βcuz you have not set it