freeCodeCamp / chapter

A self-hosted event management tool for nonprofits
BSD 3-Clause "New" or "Revised" License
1.92k stars 360 forks source link

Extraneous ' }) ' in file EventItem.tsx breaks docker build #450

Closed NorthDecoder closed 3 years ago

NorthDecoder commented 3 years ago

Describe the bug:

At commit 22a34f1 in file EventItem.tsx there is an extra }) on line 66 that is causing the build to fail.

node --version
# v14.16.0

npm --version
# 6.14.11

npx recursive-install

docker --version
# Docker version 19.03.5, build 633a0ea838

docker-compose --version
# docker-compose version 1.24.1, build 4667896

cat .env
# IS_DOCKER=TRUE

docker-compose build

# ./src/modules/dashboard/Events/components/EventItem.tsx:66:10
# Type error: Unexpected token. Did you mean `{'}'}` or `}`?

#   64 |             {event.capacity}
#   65 |           </Typography>
# > 66 |         )}
#     |          ^
#  67 |         <Typography variant="body2" color="textSecondary" component="p">
#  68 |           {event.description}
#  69 |         </Typography>
# npm ERR! code ELIFECYCLE
# npm ERR! errno 1
# npm ERR! chapter-client@1.0.0 build: `next build`
# npm ERR! Exit status 1
# npm ERR! 
# npm ERR! Failed at the chapter-client@1.0.0 build script.

Just to see that this error could have been detected before building try:

npm run lint
# ...
# /home/northdecoder/workspace/chapter/client/src/modules/dashboard/Events/components
# /EventItem.tsx
#  66:9  error  Parsing error: Unexpected token. Did you mean `{'}'}` or `&rbrace;`?
...

Tell us about your browser and operating system:

allella commented 3 years ago

@NorthDecoder

@tomnoland reported a few issues and fixes that look related.

This was introduced in https://github.com/freeCodeCamp/chapter/pull/413#issuecomment-797861480

If you or Tom can verify the fix and submit a PR then we'll get that merged in. Thanks.

Fyi, the client code currently has some errors in it. To run next build successfully make the following changes: Remove extra curly brace EventItem.tsx line 66 Remove line 50 EventsPage.tsx: className={styles.gridItem} Remove line 49 VenuesPage.tsx: className={styles.gridItem}

./src/modules/dashboard/Events/components/EventItem.tsx ./src/modules/dashboard/Events/pages/EventsPage.tsx ./src/modules/dashboard/Venues/pages/VenuesPage.tsx After those changes, then execute npm run build and npm run start