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

Comments

Projects
None yet
1 participant
@tivac
Copy link
Owner

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 tivac referenced this issue Mar 28, 2019

Merged

fix: replace multiple missing values #576

5 of 9 tasks complete

@tivac tivac closed this in #576 Mar 28, 2019

tivac added a commit that referenced this issue Mar 28, 2019

fix: replace multiple missing values (#576)
* 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
You can’t perform that action at this time.