You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DefinePlugin inserts entire object when desired object property is missing #15559
But, if a given property like VAPID_PUB_KEY, is missing, the entire secrets object is substituted in place of
just the secrets part of the expression, so that it ends up producing:
We can fix that case, but with DefinePlugin({ secrets }) you are saying replace the "secrets" variable with my secrets, do webpack is doing that. What you want to do instead is to define it more grandular via:
so it only replaces the direct reference to a secret.
@vankop will fix the case with secrets.VAPID_PUB_KEY nonetheless, but how should we behave in case of someCall(secrets)... (we will inline the whole object)
Activity
sokra commentedon Mar 28, 2022
We can fix that case, but with
DefinePlugin({ secrets })you are sayingreplace the "secrets" variable with my secrets, do webpack is doing that. What you want to do instead is to define it more grandular via:so it only replaces the direct reference to a secret.
@vankop will fix the case with
secrets.VAPID_PUB_KEYnonetheless, but how should we behave in case ofsomeCall(secrets)... (we will inline the whole object)webpack-bot commentedon Jun 27, 2022
This issue had no activity for at least three months.
It's subject to automatic issue closing if there is no activity in the next 15 days.
vankop commentedon Jun 30, 2022
@sokra please take a look #15562
webpack-bot commentedon Oct 15, 2022
Issue was closed because of inactivity.
If you think this is still a valid issue, please file a new issue with additional information.
knightcode commentedon Apr 4, 2025
noticed this happening again
alexander-akait commentedon Apr 4, 2025
@knightcode Please provide reproducible test repo
fix: resolve DefinePlugin undefined member access in more chain forms
fix: handle import.meta object keys in DefinePlugin undefined member …