Skip to content
New issue

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

ReferenceError: process is not defined #86

Open
manuel-di-iorio opened this issue Dec 13, 2021 · 1 comment
Open

ReferenceError: process is not defined #86

manuel-di-iorio opened this issue Dec 13, 2021 · 1 comment

Comments

@manuel-di-iorio
Copy link

manuel-di-iorio commented Dec 13, 2021

The bug is in this file, but this row is included in the other adapters too:
retryAdapterEnhancer.js:33

if (process.env.LOGGER_LEVEL === 'info') {
   console.info("[axios-extensions] request start retrying --> url: " + config.url + " , time: " + count);
}

To fix it, I have to add the variable with Webpack:
new DefinePlugin({ "process.env.LOGGER_LEVEL": JSON.stringify('info') });

The solution should be to not rely on a process global variable, which is not defined in browsers, but on an adapter logger option.

@marplx
Copy link

marplx commented Nov 9, 2022

If you can't do that workaround, another solution would be to set:

window.process = { ...window.process, env: { LOGGER_LEVEL: "warn" } };
somewhere before calling the extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants