We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hey Marco, Thanks for this package. It is exactly what I was looking for, the ability to use winston in the browser as well
winston
For some reason, I still have this error in devtools console:
ERROR in ./node_modules/winston/dist/winston/tail-file.js Module not found: Error: Can't resolve 'fs' in '/workspace/webapp/node_modules/winston/dist/winston' @ ./node_modules/winston/dist/winston/tail-file.js 9:9-22 @ ./node_modules/winston/dist/winston/transports/file.js @ ./node_modules/winston/dist/winston/transports/index.js @ ./node_modules/winston/dist/winston.js @ ./node_modules/offsite-logger/index.js @ ./src/stores/userStore.ts @ ./src/stores/rootStore.ts @ ./src/index.tsx ERROR in ./node_modules/winston/dist/winston/transports/file.js Module not found: Error: Can't resolve 'fs' in '/workspace/webapp/node_modules/winston/dist/winston/transports' @ ./node_modules/winston/dist/winston/transports/file.js 33:9-22 @ ./node_modules/winston/dist/winston/transports/index.js @ ./node_modules/winston/dist/winston.js @ ./node_modules/offsite-logger/index.js @ ./src/stores/userStore.ts @ ./src/stores/rootStore.ts @ ./src/index.tsx
My code is that:
import winston, { configure } from 'winston'; import BrowserConsole from 'winston-transport-browserconsole'; import { OffsiteLoggerOptions } from 'offsite-logger'; export const createOffsiteLoggerForBrowser = ({ service, moniker }: OffsiteLoggerOptions): any => { configure( new BrowserConsole({ level: 'info', }), ); return winston; };
and I am bundling with webpack to use in another of our repos
const path = require('path'); const nodeExternals = require('webpack-node-externals'); module.exports = { entry: './src/offsite-logger-browser.ts', mode: "production", module: { rules: [ { test: /\.ts?$/, use: 'ts-loader', exclude: /node_modules/, }, ], }, node: { fs: 'empty' }, resolve: { extensions: ['.ts', '.js'] }, output: { filename: 'index.js', path: path.resolve(__dirname, 'dist'), library: 'offsiteLogger', libraryTarget:'commonjs2' }, externals: [nodeExternals()] };
any idea what I am doing wrong?
The text was updated successfully, but these errors were encountered:
Same issue. Did you find a solution for this?
Sorry, something went wrong.
Same issue using createLogger with NextJS
ditto
No branches or pull requests
Hey Marco,
Thanks for this package. It is exactly what I was looking for, the ability to use
winston
in the browser as wellFor some reason, I still have this error in devtools console:
My code is that:
and I am bundling with webpack to use in another of our repos
any idea what I am doing wrong?
The text was updated successfully, but these errors were encountered: