-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Labels
7.x: regressiongood first issuehelp wantedoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issuepkg: template
Description
Choose one: is this a bug report or feature request?
bug
Input Code
const unsafeWrapTemplate = template(`
if (process.env.NODE_ENV !== "production") {
NODE;
}
`);
unsafeWrapTemplate({
NODE: path.node,
}),Expected Behavior
returns the template with NODE replaced
Current Behavior
Error: No substitution given for "NODE_ENV"
at /Users/danieltschinder/Documents/Github/react-fast-highlight/node_modules/@babel/template/lib/populate.js:16:15
at Array.forEach (<anonymous>)
at populatePlaceholders (/Users/danieltschinder/Documents/Github/react-fast-highlight/node_modules/@babel/template/lib/populate.js:14:27)
at /Users/danieltschinder/Documents/Github/react-fast-highlight/node_modules/@babel/template/lib/string.js:20:51
at /Users/danieltschinder/Documents/Github/react-fast-highlight/node_modules/@babel/template/lib/builder.js:83:14
at remove (/Users/danieltschinder/Documents/Github/react-fast-highlight/node_modules/babel-plugin-transform-react-remove-prop-types/lib/remove.js:88:28)
Possible Solution
We either need a way to whitelist ´NODE_ENV` or allow replacements to be not replaced?
Context
Found in babel-plugin-transform-react-remove-prop-types
Regressed in #6492
Your Environment
| software | version(s) |
|---|---|
| Babel | beta 35 |
| node | 8.9.3 |
| npm | 5.5 |
| Operating System | mac |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
7.x: regressiongood first issuehelp wantedoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issuepkg: template