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

support inlined process.env.DEBUG #983

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

timvandam
Copy link

@timvandam timvandam commented Dec 7, 2024

Some browser-like environments do not support localStorage nor process.env, but can be provided environment variables because they automatically get inlined (i.e. process.env.XYZ gets replaced by whatever value XYZ is during a build step). This change supports this scenario without breaking previous behavior.

As additional context, I am running into issues when trying to use debug in a Shopify POS extension. These extensions run in a sandboxed version of JS that lacks many built-ins like localStorage. Shopify's build step automatically inlines environment variables, but this still failed because process would not be defined, which the previous code required

Some browser-like environments do not support localStorage nor process.env, but can be provided environment variables because they automatically get inlined (i.e. process.env.XYZ gets replaced by whatever value XYZ is during a build step). This change supports this scenario without breaking previous behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant