prescottprue/generator-react-firebase

Failed to compoile after install

mradenovic opened this issue · 5 comments

Describe the bug

To Reproduce
Steps to reproduce the behavior:

  1. yo react-firebase
  2. yarn start
Failed to compile.

./src/routes/Projects/components/ProjectsList/ProjectsList.js
Syntax error: Unexpected token, expected ";" (20:56)

  18 | 
  19 | function useProjectsList() {
> 20 |   const { showSuccess, showError } = useNotifications()const firestore = useFirestore()
     |                                                        ^
  21 | 
  22 |   // Get auth from redux state
  23 |   const auth = useSelector(({ firebase: { auth } }) => auth)

Expected behavior/code
Project running in dev mode.

Possible Solution
The problem is probably somewhere in generators/app/templates/src/routes/Projects/components/ProjectsList/ProjectsList.js

Additional Context/Screenshots
If I manually fix code in ProjectsList.js :

const { showSuccess, showError } = useNotifications()
const firestore = useFirestore()

I get the next error:

Failed to compile.

./src/utils/firebaseMessaging.js
Attempted import error: 'modules/notification' does not contain a default export (imported as 'messageActions').

@mradenovic Thanks for reporting, can you post which options you used while generating?

I tried with different options and I had the same result, and this is the content the last .yo-rc.json. I hope it helps,

{
  "generator-react-firebase": {
    "promptValues": {
      "githubUser": "mradenovic",
      "firebaseName": "XXX",
      "firebaseKey": "XXX",
      "includeRedux": true,
      "includeFirestore": true,
      "otherFeatures": [
        "Continuous Integration config",
        "Firebase Cloud Messaging",
        "Firebase Functions (with ESNext support)",
        "Firebase Analytics"
      ],
      "functionsTestTool": "jest",
      "messagingSenderId": "XXX",
      "measurementId": "XXX",
      "appId": "XXX",
      "firebasePublicVapidKey": "XXX",
      "ciProvider": "githubActions",
      "deployTo": "firebase"
    }
  }
}

There has been some recent work on the non-redux side of things, so wondering if those changes may have caused issues on the redux side. Thanks for reporting, I'm looking into it

v5.6.0 release includes a fix for this. Thanks for reporting!

Side note: If you are starting a new project you may want to consider if redux is needed at all - in the upcoming major version of this project I'm planning to switch to having no redux be the default.

@prescottprue I agree about redux. I am comparing both options to see if it is needed 😄

I just tested the new version. Works fine without redux.

With redux, when I visit http://localhost:3000/projects, throws an error:

screencapture-localhost-3000-projects-2020-04-27-10_20_31