login-with-metamask icon indicating copy to clipboard operation
login-with-metamask copied to clipboard

Fix frontend Dockerfile

Open amaury1093 opened this issue 4 years ago • 5 comments

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

amaury1093 avatar Nov 29 '20 18:11 amaury1093

I am trying to launch frontend only with "npm start" and facing same issue

PGoski avatar Dec 22 '21 21:12 PGoski

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?

amaury1093 avatar Jan 03 '22 11:01 amaury1093

same here; No idea yet for what it's; Windows 10, VSCode, node 16.8.0

marcoslobo avatar Jan 18 '22 01:01 marcoslobo

i fixed this by adding this to the frontend package.json

"eslintConfig": {
	"extends": [
		"react-app",
		"react-app/jest"
	]
},

anonymous-sushi avatar Feb 27 '22 04:02 anonymous-sushi

@anonymous-sushi Nice, would you like to create a PR?

amaury1093 avatar Feb 27 '22 10:02 amaury1093