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

Unexpected token ' . ' [solved] #22

Closed
fskhri opened this issue Jan 2, 2023 · 12 comments
Closed

Unexpected token ' . ' [solved] #22

fskhri opened this issue Jan 2, 2023 · 12 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@fskhri
Copy link
Contributor

fskhri commented Jan 2, 2023

error code:

index.js:226
let reason = new Boom(lastDisconnect?.error)?.output.statusCode
^

SyntaxError: Unexpected token '.'

@Slavecode
Copy link

Vps azure?

@fskhri
Copy link
Contributor Author

fskhri commented Jan 2, 2023

localhost

@fskhri
Copy link
Contributor Author

fskhri commented Jan 2, 2023

im using linux LTS

image

sebelum nya normal, tapi setelah saya ganti device hp malah jadi kayak gitu

@Sansekai
Copy link
Owner

Sansekai commented Jan 5, 2023

Byk juga yg ngalamin ini tapi saya blm nemu solusinya😁.

Mungkin teman-teman yang lain bisa bantu

@Sansekai Sansekai added bug Something isn't working help wanted Extra attention is needed labels Jan 5, 2023
@harshitethic
Copy link

It looks like there is a problem with the JavaScript syntax on line 226 of your index.js file.
It seems that your code is trying to use this operator, but it is not supported in the version of JavaScript that you are using. To fix the error, you will need to either update to a newer version of JavaScript that supports the optional chaining operator, or use a different technique to access the property that you need.

let reason;
if (lastDisconnect && lastDisconnect.error) {
reason = new Boom(lastDisconnect.error).output.statusCode;
}

This code uses an if statement to check if the lastDisconnect and lastDisconnect.error objects exist before trying to access their properties. #fix

@wahyuda110
Copy link

sama bang cara solved nya gmna ya??

@fskhri fskhri closed this as completed Jan 14, 2023
@fskhri fskhri reopened this Jan 14, 2023
@fskhri fskhri closed this as completed Jan 14, 2023
@wahyuda110
Copy link

wahyuda110 commented Jan 14, 2023

tetap error bang udh hapus repo install ulang lgi
image

@fskhri fskhri reopened this Jan 14, 2023
@wahyuda110
Copy link

Solved gan , harus pake node versi 16 untuk solved di vps/c9 gunakan command ini

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
source ~/.bashrc
nvm install 16
nvm use 16
node -v

@Sansekai Sansekai pinned this issue Jan 22, 2023
@Sansekai Sansekai changed the title ga bisa konek ke wa Unexpected token ' . ' [solved] Jan 22, 2023
@fdciabdul
Copy link

fdciabdul commented Mar 16, 2023

karna ternary methode itu hanya support di nodejs v16 keatas ,

default install nodejs pada saat pertama install di ubuntu itu versi 12 , jadi harus di upgrade versi nodejs nya

sudo npm install -g n
n install lts
hash -r

@YogaSetiawanXsaintz
Copy link

eror:openai.createChatCompletion is not a function

plase solution please...

@fskhri
Copy link
Contributor Author

fskhri commented Mar 29, 2023

You need to update the OpenAI package

npm update openai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

8 participants
@wahyuda110 @fdciabdul @Sansekai @fskhri @Slavecode @harshitethic @YogaSetiawanXsaintz and others