rrdelaney / reason-scripts

:beginner: Create a ReasonML and React development environment
MIT License
628 stars 58 forks source link

missing part of the error message at terminal #71

Closed bsr203 closed 5 years ago

bsr203 commented 6 years ago

Hi,

I created a project using reason scripts, and found the key part of the error message is missing on the terminal (yarn start), compared to the error displayed in the browser.

At the terminal:

  33 ┆   | "" => ReasonReact.NoUpdate
  34 ┆   | nonEmptyValue =>
  35 ┆     state.todos
  36 ┆     @ [
   . ┆ ...
  41 ┆       },
  42 ┆     ]
  43 ┆   }
  44 ┆ | Edit(todo) => ReasonReact.NoUpdate

  This has type:
    list(TodoItem.todo)
  But somewhere wanted:
    at Array.map (<anonymous>)'a, action)

In browser:

  33 ┆   | "" => ReasonReact.NoUpdate
  34 ┆   | nonEmptyValue =>
  35 ┆     state.todos
  36 ┆     @ [
   . ┆ ...
  41 ┆       },
  42 ┆     ]
  43 ┆   }
  44 ┆ | Edit(todo) => ReasonReact.NoUpdate

  This has type:
    list(TodoItem.todo)
  But somewhere wanted:
    ReasonReact.update(state, 'a, action)    at Array.map (<anonymous>)

so the key part of the message was ReasonReact.update(state, 'a, action) , which somehow missing in the terminal. Not quite sure reason-scripts formats and misses part of the error from the compiler.

anmonteiro commented 6 years ago

is this using 1.0.0-beta4?

bsr203 commented 6 years ago

I was using "0.9.0", but updated to 1.0.0-beta4 and results is same.

It is easy to reproduce.

  1. yarn create react-app reason-scripts-bug --scripts-version reason-scripts
  2. Edit App.re. line 18 from (ReasonReact.string("and save to reload.")) to "and save to reload."

error on terminal:

  17 ┆     <code> (ReasonReact.string(" src/App.re ")) </code>
  18 ┆     "and save to reload."
  19 ┆   </p>
  20 ┆ </div>,

  This has type:
    string
  But somewhere wanted:
    at Array.map (<anonymous>)

In browser:

16 ┆     (ReasonReact.string("To get started, edit"))
  17 ┆     <code> (ReasonReact.string(" src/App.re ")) </code>
  18 ┆     "and save to reload."
  19 ┆   </p>
  20 ┆ </div>,

  This has type:
    string
  But somewhere wanted:
    ReasonReact.reactElement    at Array.map (<anonymous>)