I have been attempting to integrate @google-cloud/logging-winston into my VueJS project by closely following the guidelines provided in both the npm package and Google Cloud docs.
However, I am encountering an error message stating
"TypeError: The "original" argument must be of type Function"
I am puzzled as to why this line
const {LoggingWinston} = require('@google-cloud/logging-winston')
is causing the issue when it is directly from the official documentation. Any insights or possible solutions would be greatly appreciated.
const winston = require('winston');
// The error occurs here:
const {LoggingWinston} = require('@google-cloud/logging-winston');
// The code stops here and does not proceed further
const gcloudWinston = new LoggingWinston();
const logConfiguration = {
format: winston.format.json(),
'transports': [
new winston.transports.Console(),
// Adding Cloud Logging
gcloudWinston,
]
};
const logger = winston.createLogger(logConfiguration);
export default { logger }