Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

App Crash while starting #67

Open
djpanda opened this issue Oct 28, 2022 · 6 comments
Open

App Crash while starting #67

djpanda opened this issue Oct 28, 2022 · 6 comments

Comments

@djpanda
Copy link

djpanda commented Oct 28, 2022

npm start

[email protected] start
export NODE_ENV=production && cd server && npm start

[email protected] start
npm run dev

[email protected] 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
Copy link
Owner

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
Copy link
Author

djpanda commented Oct 28, 2022

Step 8:

$ npm run build-client

[email protected] build-client
cd client && npm run build

[email protected] 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

[email protected] start
export NODE_ENV=production && cd server && npm start

[email protected] start
npm run dev

[email protected] 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
Copy link
Author

djpanda commented Oct 28, 2022

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
Copy link
Author

djpanda commented Oct 28, 2022

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
Copy link
Author

djpanda commented Oct 28, 2022

client/.env unchanged

@djpanda
Copy link
Author

djpanda commented Oct 28, 2022

$ sudo git restore .
$ npm run build-client

[email protected] build-client
cd client && npm run build

[email protected] 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

[email protected] start
export NODE_ENV=production && cd server && npm start

[email protected] start
npm run dev

[email protected] 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...

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

No branches or pull requests

2 participants