Closed michelbl closed 7 years ago
Is there a way to add the date and time the error happened ? This is very useful information when production bugs appears 😄
It incited me to add configuration for winston.
I still have errors about json parsing :
ERROR in ./~/winston/package.json
[1] Module parse failed: /data/projects/openfisca/legislation-explorer/node_modules/winston/package.json Unexpected token (2:9)
[1] You may need an appropriate loader to handle this file type.
[1] SyntaxError: Unexpected token (2:9)
I still have errors about json parsing
This could be linked to ES2015 imports: you are calling import
rather than require
, and that call is transpiled. You can try the solution presented in https://github.com/winstonjs/winston/issues/801, or try to replace import winston from "winston"
to let winston = require('winston')
.
Is there a way to automate this test ?
Yes, but that means adding a backend testing stack for it. That would be welcome. See this example.
This could be linked to ES2015 imports: you are calling import rather than require, and that call is transpiled. You can try the solution presented in winstonjs/winston#801, or try to replace import winston from "winston" to let winston = require('winston').
I tried const winston = require('winston')
, import * as winston from 'winston'
, let winston = require('winston')
, import winston from "winston"
and none of them work.
Seems to work :
[0] 2017-06-15T14:17:15.553Z - error: GET /
[0] TypeError: Cannot read property 'b' of undefined
[0] at /Users/fpagnoux/dev/openfisca/legislation-explorer/src/server/render.jsx:16:5
...
@MattiSG is this GTM for you ?
Wait 5 minutes, I'll handle changes.
Ok, error page usability improved.
Connected to #86.
To test the logging, I added some code intended to fail here : https://github.com/openfisca/legislation-explorer/blob/master/src/server/render.jsx#L15 :
Console output is :
The stack is logged twice.
Is there a way to automate this test ?