-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Using the JS Client SDK out-of-the box causes an error when the web app is loaded:
"Uncaught (in promise) ReferenceError: process is not defined"
The error occurs on line 9 of @eppo/js-client-sdk/common/dist/application-logger.js
:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.logger = exports.loggerPrefix = void 0;
const pino_1 = require("pino");
exports.loggerPrefix = '[Eppo SDK]';
// Create a Pino logger instance
exports.logger = (0, pino_1.default)({
// eslint-disable-next-line no-restricted-globals
>>> level: process.env.LOG_LEVEL ?? (process.env.NODE_ENV === 'production' ? 'warn' : 'info'),
// https://getpino.io/#/docs/browser
browser: { disabled: true },
});
//# sourceMappingURL=application-logger.js.map
In order to solve this, I had to manually add these lines to my own webpack configuration:
js-client-sdk/webpack.config.js
Line 41 in 7771ace
// Replace process.env.LOG_LEVEL with null (`process` is not defined in the browser env) |
I'm using version 3.16.1 (the current version when I typed this).
edisonaugusthy
Metadata
Metadata
Assignees
Labels
No labels