FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

support inlined process.env.DEBUG by timvandam · Pull Request #983 · debug-js/debug · GitHub

/ debug Public

support inlined process.env.DEBUG - #983

Open
timvandam wants to merge 1 commit into
debug-js:masterfrom
timvandam:patch-1
Open

support inlined process.env.DEBUG#983
timvandam wants to merge 1 commit into
debug-js:masterfrom
timvandam:patch-1

Conversation

timvandam commented Dec 7, 2024
edited
Loading

Copy link
Copy Markdown

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.

Possumkitty left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks so much this really helped me!!

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

2 participants


Back | FazBrowse Home | New Git URL