login-with-metamask
login-with-metamask copied to clipboard
Fix frontend Dockerfile
Repro
docker-compose up --build
Expected
Runs backend and frontend
Actual
Cannot run frontend, got error
frontend_1 | ℹ 「wds」: Project is running at http://172.21.0.3/
frontend_1 | ℹ 「wds」: webpack output is served from /login-with-metamask-demo
frontend_1 | ℹ 「wds」: Content not from webpack is served from /app/public
frontend_1 | ℹ 「wds」: 404s will fallback to /login-with-metamask-demo/
frontend_1 | Starting the development server...
frontend_1 |
frontend_1 | Failed to compile.
frontend_1 |
frontend_1 | src/Login/Login.tsx
frontend_1 | Syntax error: Unexpected token, expected "," (38:16)
frontend_1 |
frontend_1 | 36 |
frontend_1 | 37 | // Check if MetaMask is installed
frontend_1 | > 38 | if (!(window as any).ethereum) {
frontend_1 | | ^
frontend_1 | 39 | window.alert('Please install MetaMask first.');
frontend_1 | 40 | return;
frontend_1 | 41 | }
The weird thing is, running it without Docker works:
cd packages/frontend
yarn start
I am trying to launch frontend only with "npm start" and facing same issue
I never managed to reproduce this locally, which is hard to debug for me.
@PGoski could you share your environment? Do you have an idea why there's an error?
same here; No idea yet for what it's; Windows 10, VSCode, node 16.8.0
i fixed this by adding this to the frontend package.json
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
@anonymous-sushi Nice, would you like to create a PR?