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

v23 doesn't replace multiple invalid {css.key} entries #575

Closed
tivac opened this issue Mar 28, 2019 · 0 comments · Fixed by #576
Closed

v23 doesn't replace multiple invalid {css.key} entries #575

tivac opened this issue Mar 28, 2019 · 0 comments · Fixed by #576

Comments

@tivac
Copy link
Owner

tivac commented Mar 28, 2019

Expected Behavior

If there's more than one {css.key} value that doesn't exist they should be replaced

Current Behavior

Only the first is replaced

Possible Solution

new RegExp(`(${missed.map((ref) => escape(ref)).join("|")})`),

Needs to have the g flag set so it can match multiple times.

Steps to Reproduce (for bugs)

  1. Create a template with multiple <div class="{css.key}" /> entries where key is different each time
  2. Run it
  3. Notice that only the first has been updated

Context

Trying to add new components and rough-in classnames still causes JS explosions

Your Environment

Executable Version
modular-css v23.0.0
npm --version 6.9.0
node --version 10.12.0
tivac added a commit that referenced this issue Mar 28, 2019
tivac added a commit that referenced this issue Mar 28, 2019
* test: failing specimens & snapshot for #575
* fix: add g flag to missing key regex

Fixes #575
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

Successfully merging a pull request may close this issue.

1 participant