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

Errors in some variables in the file docker-compose/envs/common-frontend.env #8395

Closed
jasonzysun opened this issue Sep 5, 2023 · 0 comments · Fixed by #8396
Closed

Errors in some variables in the file docker-compose/envs/common-frontend.env #8395

jasonzysun opened this issue Sep 5, 2023 · 0 comments · Fixed by #8396

Comments

@jasonzysun
Copy link
Contributor

Describe your issue here.

Environment

  • Deployment type (Manual/Docker/Docker-compose):Docker-compose
  • Operating System: Ubuntu 22.04 LTS (GNU/Linux 5.15.0-37-generic x86_64)
  • Blockscout Version/branch/commit: master
  • Archive node type && version (Erigon/Geth/Nethermind/Ganache/?): Geth

Steps to reproduce

Tell us how to reproduce this issue. ❤️ if you can push up a branch to your fork with a regression test we can run to reproduce locally.
Errors in some variables in the file docker-compose/envs/common-frontend.env can cause the following issues:

  1. NEXT_PUBLIC_IS_TESTNET='true' and NEXT_PUBLIC_API_WEBSOCKET_PROTOCOL='ws' are invalid literal values, which will cause errors when verifying the environment variable architecture. Such as these following:

Invalid literal value, expected "true" at "NEXT_PUBLIC_IS_TESTNET", or Invalid literal value, expected "" at "NEXT_PUBLIC_IS_TESTNET";
Invalid literal value, expected "ws" at "NEXT_PUBLIC_API_WEBSOCKET_PROTOCOL", or Invalid literal value, expected "wss" at "NEXT_PUBLIC_API_WEBSOCKET_PROTOCOL"

  1. NEXT_PUBLIC_HOMEPAGE_CHARTS="['daily_txs']" and NEXT_PUBLIC_HOMEPAGE_PLATE_TEXT_COLOR="rgb(255, 255, 255)" will casue errors when you try to view the frontend page by your domain or http://ip:port. Such as these following:

Error [SyntaxError]: missing ) after argument list
at (file:///app/.next/server/middleware.js:1960)
at new Script (node:vm:94:7)
at createScript (node:vm:251:10)
at runInContext (node:vm:282:10)
at evaluateInContext (file:///app/node_modules/next/dist/server/web/sandbox/context.js:360:38)
at getRuntimeContext (file:///app/node_modules/next/dist/server/web/sandbox/sandbox.js:69:9)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runWithTaggedErrors (file:///app/node_modules/next/dist/server/web/sandbox/sandbox.js:75:21)
at async NextNodeServer.runMiddleware (file:///app/node_modules/next/dist/server/next-server.js:1610:24)
at async Object.fn (file:///app/node_modules/next/dist/server/next-server.js:1754:42)
at async Router.execute (file:///app/node_modules/next/dist/server/router.js:315:32)
/app/.next/server/chunks/5784.js:636
charts: parseEnvJson(getEnvValue(""['daily_txs']"")) || [],

Error [SyntaxError]: missing ) after argument list
at (file:///app/.next/server/middleware.js:1963)
at new Script (node:vm:94:7)
at createScript (node:vm:251:10)
at runInContext (node:vm:282:10)
at evaluateInContext (file:///app/node_modules/next/dist/server/web/sandbox/context.js:360:38)
at getRuntimeContext (file:///app/node_modules/next/dist/server/web/sandbox/sandbox.js:69:9)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runWithTaggedErrors (file:///app/node_modules/next/dist/server/web/sandbox/sandbox.js:75:21)
at async NextNodeServer.runMiddleware (file:///app/node_modules/next/dist/server/next-server.js:1610:24)
at async Object.fn (file:///app/node_modules/next/dist/server/next-server.js:1754:42)
at async Router.execute (file:///app/node_modules/next/dist/server/router.js:315:32)
/app/.next/server/chunks/5784.js:639
textColor: getEnvValue(""rgb(255, 255, 255)"") || "white"

how to fix them:

Remove the outermost single or double quotation marks from the value of these variables. Such following:
Update these variables in docker-compose/envs/common-frontend.env:
NEXT_PUBLIC_IS_TESTNET='true' -> NEXT_PUBLIC_IS_TESTNET=true
NEXT_PUBLIC_API_WEBSOCKET_PROTOCOL='ws' -> NEXT_PUBLIC_API_WEBSOCKET_PROTOCOL=ws
NEXT_PUBLIC_HOMEPAGE_CHARTS="['daily_txs']" -> NEXT_PUBLIC_HOMEPAGE_CHARTS=['daily_txs']
NEXT_PUBLIC_HOMEPAGE_PLATE_TEXT_COLOR="rgb(255, 255, 255)" -> NEXT_PUBLIC_HOMEPAGE_PLATE_TEXT_COLOR=rgb(255, 255, 255)

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

Successfully merging a pull request may close this issue.

1 participant