Content-Length: 230634 | pFad | http://github.com/trevorblades/sorrento/issues/47

2A Unable to start the API's · Issue #47 · trevorblades/sorrento · GitHub
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

Unable to start the API's #47

Open
dep1engenharia opened this issue Aug 3, 2023 · 4 comments
Open

Unable to start the API's #47

dep1engenharia opened this issue Aug 3, 2023 · 4 comments

Comments

@dep1engenharia
Copy link

Hello dear Trevor,

I'm having some problems to make this project work. I tried like 10 fresh installs and I'm always facing problems related with the missing file jsonwebtoken.d.ts.

Can you help me with this?

Can you provide more information about the instalation?

I tried with both yarn and npm install, personaly I prefere to use npm install.

I created a .env file;
JWT_SECRET=mysecretkey
TWILIO_ACCOUNT_SID=youraccountsid
TWILIO_AUTH_TOKEN=yourauthtoken

I have successfuly launch a lot of projects this is the first I'm geting issues.
And this is the first I do want to have ahaha

I hope o can help me.
Thank you :)

@trevorblades
Copy link
Owner

Hey there! This project uses yarn v1, so if you want to try running it locally, you should use yarn. That being said, I open sourced this repo just for transparency and didn't actually expect anyone else to try to run it.

But if you do want to get the API running, you need to set up a few things:

  • A postgres database: I'd recommend using postgres.app if you're on a Mac. You'll need to set the DATABASE_URL env variable to the postgres://... URL to your database
  • I'm using node 18. This project uses volta to automatically install the correct node version
  • I also set a PORT env variable

What does your installation error look like? Could you copy/paste it here?

@dep1engenharia
Copy link
Author

Hello again :)

This is a cool project, why not give it a try? :)

ERROR:
dep1@dep1-VirtualBox:~/Downloads/sorrento-main/api$ yarn start
yarn run v1.22.19
warning package.json: No license field
warning ../package.json: No license field
$ nodemon -r dotenv/config --loader ts-node/esm --experimental-specifier-resolution node src
[nodemon] 3.0.1
[nodemon] to restart at any time, enter rs
[nodemon] watching path(s): .
[nodemon] watching extensions: js,mjs,cjs,json
[nodemon] starting node -r dotenv/config --loader ts-node/esm --experimental-specifier-resolution node src
(node:74592) ExperimentalWarning: Custom ESM Loaders is an experimental feature. This feature could change at any time
(Use node --trace-warnings ... to show where the warning was created)
(node:74592) ExperimentalWarning: The Node.js specifier resolution flag is experimental. It could change or be removed at any time.
/home/dep1/Downloads/sorrento-main/api/node_modules/ts-node/src/index.ts:859
return new TSError(diagnosticText, diagnosticCodes, diagnostics);
^
**TSError: ⨯ Unable to compile TypeScript:
src/resolvers.ts:14:27 - error TS2307: Cannot find module './generated/graphql.js' or its corresponding type declarations.

14 import { Resolvers } from "./generated/graphql.js";**
~~~~~~~~~~~~~~~~~~~~~~~~
src/resolvers.ts:36:10 - error TS7006: Parameter '_' implicitly has an 'any' type.

36 me: (_, , { user }) => user,
~
src/resolvers.ts:36:13 - error TS7006: Parameter '
' implicitly has an 'any' type.

36 me: (_, __, { user }) => user,

MORE ERRORS:

dep1@dep1-VirtualBox:~/Downloads/sorrento-main/api$ yarn start
yarn run v1.22.19
warning package.json: No license field
warning ../package.json: No license field
$ nodemon -r dotenv/config --loader ts-node/esm --experimental-specifier-resolution node src
[nodemon] 3.0.1
[nodemon] to restart at any time, enter rs
[nodemon] watching path(s): .
[nodemon] watching extensions: js,mjs,cjs,json
[nodemon] starting node -r dotenv/config --loader ts-node/esm --experimental-specifier-resolution node src
(node:76163) ExperimentalWarning: Custom ESM Loaders is an experimental feature. This feature could change at any time
(Use node --trace-warnings ... to show where the warning was created)
(node:76163) ExperimentalWarning: The Node.js specifier resolution flag is experimental. It could change or be removed at any time.
/home/dep1/Downloads/sorrento-main/api/node_modules/ts-node/src/index.ts:859
return new TSError(diagnosticText, diagnosticCodes, diagnostics);
^
TSError: ⨯ Unable to compile TypeScript:
**src/index.ts:21:32 - error TS7016: Could not find a declaration file for module 'jsonwebtoken'. '/home/dep1/Downloads/sorrento-main/api/node_modules/jsonwebtoken/index.js' implicitly has an 'any' type.
Try npm i --save-dev @types/jsonwebtoken if it exists or add a new declaration (.d.ts) file containing declare module 'jsonwebtoken';

21 import { default as jwt } from "jsonwebtoken";**

########################################################################################
I have a postgres database runing on docker:

Here my .env file:
NEXT_PUBLIC_API_URL=http://localhost:4000/graphql
NEXT_PUBLIC_WS_URL=ws://localhost:4000/graphql
DATABASE_URL=postgres://youruser:yourpassword@localhost:5432/yourdb
PORT=3000

I'm using chat gpt to help me set this thing up but even that way i couldn't get it.
I'm also using linux(Ubuntu)

@trevorblades
Copy link
Owner

Oh I see. You're missing the generated GraphQL files (generated/graphql.js) which are created by GraphQL codegen. You'll need to run yarn gql before starting the server.

What do you plan on doing with this project once you have it set up?

@dep1engenharia
Copy link
Author

I'll try to install the GraphQL files again carefully.

I don't know what I will do with the project but I know two things

1 - With this project I will not be the next Sam Altman or Mark Zuckerberg down the road ehehe
2 - I can even compile the project xD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/trevorblades/sorrento/issues/47

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy