Just-Moh-it / Pckd

The ⚡️ analytics-intensive, self-hostable link-shortener with a beautiful UI | AKA free bit.ly alternative 🚀
https://docs.pckd.me/
MIT License
783 stars 95 forks source link

App Crash while starting #67

Open djpanda opened 1 year ago

djpanda commented 1 year ago

npm start

pckd@1.0.0 start export NODE_ENV=production && cd server && npm start

api@1.0.0 start npm run dev

api@1.0.0 dev nodemon src/.

[nodemon] 2.0.20 [nodemon] to restart at any time, enter rs [nodemon] watching path(s): . [nodemon] watching extensions: js,mjs,json [nodemon] starting node src/. /var/www/short.webport.at/public_html/server/src/utils/isp.js:11 type: data?.company?.type, ^

SyntaxError: Unexpected token '.' at wrapSafe (internal/modules/cjs/loader.js:915:16) at Module._compile (internal/modules/cjs/loader.js:963:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) at Module.require (internal/modules/cjs/loader.js:887:19) at require (internal/modules/cjs/helpers.js:74:18) at Object. (/var/www/short.webport.at/public_html/server/src/utils/hitInsert.js:1:13) at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) [nodemon] app crashed - waiting for file changes before starting...

Just-Moh-it commented 1 year ago

This seems like an unexpected error. Is the non-dev version working (step 8) in docs. Also, I think you might have added an unexpected character somewhere in the code. Could you run the git restore . command or re-clone the repo if the error exists

djpanda commented 1 year ago

Step 8:

$ npm run build-client

pckd@1.0.0 build-client cd client && npm run build

pckd@0.1.0 build react-scripts build

Creating an optimized production build... Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating Compiled successfully.

File sizes after gzip:

427.35 kB build/static/js/main.7039773b.js

The project was built assuming it is hosted at /manage/. You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.

Find out more about deployment here:

https://cra.link/deployment

djpanda@web:/var/www/short.webport.at/public_html$ npm start

pckd@1.0.0 start export NODE_ENV=production && cd server && npm start

api@1.0.0 start npm run dev

api@1.0.0 dev nodemon src/.

[nodemon] 2.0.20 [nodemon] to restart at any time, enter rs [nodemon] watching path(s): . [nodemon] watching extensions: js,mjs,json [nodemon] starting node src/. /var/www/short.webport.at/public_html/server/src/utils/isp.js:11 type: data?.company?.type, ^

SyntaxError: Unexpected token '.' at wrapSafe (internal/modules/cjs/loader.js:915:16) at Module._compile (internal/modules/cjs/loader.js:963:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) at Module.require (internal/modules/cjs/loader.js:887:19) at require (internal/modules/cjs/helpers.js:74:18) at Object. (/var/www/short.webport.at/public_html/server/src/utils/hitInsert.js:1:13) at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) [nodemon] app crashed - waiting for file changes before starting...

djpanda commented 1 year ago

THe only files i altered are the ones in the docs. "client and server folder and fill in the values in the .env file" "server/prisma/schema.prisma file and replace postgresql" was already mysql. Didnt hat to change anything there

djpanda commented 1 year ago

Server/.env

Optional: Port to run backend server on

PORT=4000

Format Detailshttps://www.prisma.io/docs/reference/database-reference/connection-urls

DATABASE_URL="mysql://pschkodrt:z10zq3CLD%8g07RFvaYFU8cYX6s9z%96@localhost:3306/shortpckd?schema=public&pool_timeout=0"

Format: 16 digit alphanumric code

IPREGISTRY_API_KEY="bafluzh969ph3ky9"

eg: hm1y2wq1pzck

JWT_SECRET="zH9aKb!d2VO!"

Optional: If you are running behind a proxy, enable this so the backend gets the correct IP.

Format: "true"/"false" or the proxy IP(s)

TRUST_PROXY="true"

Alphanumerics and Numbers Changed, position switched and the Symbols too, but thats the .env nearest without giving out my secrets ^^

djpanda commented 1 year ago

client/.env unchanged

djpanda commented 1 year ago

$ sudo git restore . $ npm run build-client

pckd@1.0.0 build-client cd client && npm run build

pckd@0.1.0 build react-scripts build

Creating an optimized production build... Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating Compiled successfully.

File sizes after gzip:

427.35 kB build/static/js/main.7039773b.js

The project was built assuming it is hosted at /manage/. You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.

Find out more about deployment here:

https://cra.link/deployment

$ npm start

pckd@1.0.0 start export NODE_ENV=production && cd server && npm start

api@1.0.0 start npm run dev

api@1.0.0 dev nodemon src/.

[nodemon] 2.0.20 [nodemon] to restart at any time, enter rs [nodemon] watching path(s): . [nodemon] watching extensions: js,mjs,json [nodemon] starting node src/. /var/www/short.webport.at/public_html/server/src/utils/isp.js:11 type: data?.company?.type, ^

SyntaxError: Unexpected token '.' at wrapSafe (internal/modules/cjs/loader.js:915:16) at Module._compile (internal/modules/cjs/loader.js:963:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) at Module.require (internal/modules/cjs/loader.js:887:19) at require (internal/modules/cjs/helpers.js:74:18) at Object. (/var/www/short.webport.at/public_html/server/src/utils/hitInsert.js:1:13) at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) [nodemon] app crashed - waiting for file changes before starting...