blogging

Metro Bundler error: Invalid regular expression | node > 12.9 Windows

TLDR: If you’re doing React Native Expo development on a Windoze machine and have node version > 12.9 Metro Bundler will fail with a regex error:

error Invalid regular expression: /(.*\\__fixtures__\\.*|node_modules[\\\]react[\\\]dist[\\\].*|website\\node_modules\\.*|heapCapture\\bundle\.js|.*\\__tests__\\.*)$/: Unterminated character class.

Seems like two fixes for this:

  1. Downgrade your version of node, as stated on this expo-cli GitHub ticket
  2. Update the regex in metro-config/src/defaults/blacklist.js:
    from

    var sharedBlacklist = [
      /node_modules[/\\]react[/\\]dist[/\\].*/,
      /website\/node_modules\/.*/,
      /heapCapture\/bundle\.js/,
      /.*\/__tests__\/.*/

    ];

    to

    var sharedBlacklist = [
      /node_modules[\/\\]react[\/\\]dist[\/\\].*/,
      /website\/node_modules\/.*/,
      /heapCapture\/bundle\.js/,
      /.*\/__tests__\/.*/
    ];
    note the additional escapes in the expr: /node_modules[\/\\]react[\/\\]dist[\/\\].*/,
    the difference is very subtle

Hoping this helps anyone encountering this issue. If you don’t downgrade node (which might not be an option for everyone), then every new project or any time you npm i, you’ll need to perform this regex replacement in the metro-config/src/defaults/blacklist.js file.

blogging

Email field with space in React 16 backspace issue

TLDR: There’s an “issue” with backspace in an input type=email field and React 16 that has a conversation going on here.

While working on a React project, a testing “issue” came up while testing an email input field. I use “air quotes” here because… Well, spaces in email fields aren’t really a thing you’d happen upon in common real-world scenarios. Nonetheless, it’s a legitimate (albeit, non-critical) issue that you may encounter during dev/testing of a React app.

A tester was testing a login form and entered “Here is a test” into the email field to test if the field validation was working. Sure enough, that input was identified as an invalid email address. Okay! Time to go home. Until they tester started backspacing in the email field and found the cursor suddenly jump to the beginning of the field when backspacing over the space. In other words, the cursor jumped from the a to before the H at the very beginning of the email field and did not delete/backspace over the text.

After sleuthing, I found the above mentioned link. Linked here again if anyone encounters the same “issue” while testing backspacing in an input type=email field while developing in React. GitHub poster’s fiddle demonstrating the issue can be found here.

blogging

npm install bcrypt fails on Windoze

Getting started with a fresh windoze dev environment and went to install the npm bcrypt package. Ended up with an error while building… Found many recommendations to just install bcryptjs, which wasn’t an option I was interested in. Found some sage advice of (Powershell with Admin rights):

//Temporarily disable Real-time protection within Windoze Defender
npm install -g node-gyp
npm install -g --production windows-build-tools

went with that instead. npm i bcrypt worked like a charm!

art, blogging, culture, friends, life, photos, travel

Donde está la biblioteca

It’s one of the first phrases you learn in high school Spanish: Donde está la biblioteca

And the running joke is that you will never use that phrase in a real conversation.

Deadpool’s translation is way off. “Donde está la biblioteca” = “Where is the library”, not:

On my latest trip to Cabo with my beautiful wife to help plan her upcoming country music charity festival, the phrase “Donde está la biblioteca” was finally put to good use! We had heard so many great things about the art walk over the last year, and this trip we decided to check it out. We had visited downtown San José del Cabo the Sunday before to explore some of the potential locations for holding a large outdoor gathering, so we were able to familiarize ourselves with the area a bit.

The area around Parroquia San José is a lively place! It’s also at the heart of the art walk we knew we were going to see on Thursday. We spent some time in the square, soaking up the atmosphere and energy.

The experience inside the Parish was invigorating! Perhaps it was the cool inside air, or it was an adventure for my soul. Either way, this is a must for anyone visiting Cabo!

The Wednesday before the art walk, my wife and I were spending some time with the great artists at Blanco Creative at the Koral Center El Merkado. We got onto the topic of conversational Spanish vs. academic Spanish (as well as how growing up in Los Angeles, I learned all the bad words before I knew anything else). Naturally, “Donde está la biblioteca” came up. We all had a great laugh saying “Donde está la biblioteca” in a super formal manner.

“Donde está la biblioteca” is definitely a term one will almost certainly never use in everyday conversation, right?

Fast forward to the next evening with my wife and I back in beautiful downtown San José del Cabo. We were working longer than expected that evening and didn’t head over until a bit later than we anticipated. When we got there, parking was hard to come by. Later on, we found out there is great parking for art walk visitors just south of the Parish, but we ended up parking several blocks away from the bustling art district.

It was pretty easy to find our way to the festivities. We grabbed a couple of nitro coffees at The Breakdown and started perusing the art scene! There was so much to see. I’ll have to write-up another blog just to touch on the art we got to see and experience, and we only got to see the tip of the iceberg on this first visit.

There was one small gallery that was calling my name though. While my wife and I were making a B-line for our coffees, I saw the gallery out of the corner of my eye and said, “I really want to go to that one.” After we got our coffees and looked around at some of the art displays in the small square outside The Breakdown, we headed over to the small gallery.

It’s hard to describe the experience when we stepped inside this small gallery. The visuals and audio are easy to explain: beautiful handmade jewelry with unique, colorful stones; colorful paintings; lively music from The Baja Brewing Company just on the other side of the back wall; and happy artists inside. But there was more to it than just what can be explained with simple words. There was magic!

I was really impressed with the silver work by Oscar Vargas. We chatted for a bit with him about his craft. As a horologist, I have a great appreciation for handcrafted jewelry, and Oscar’s love of his work was evident in his art.

After picking up a couple of pieces of beautiful jewelry from Oscar, my wife and I still felt like something was calling us in the gallery. We looked around at the paintings, all of them beautiful work! As we were about to head out and on to the rest of the art walk, there was one painting that really called to us both. Interestingly enough, it wasn’t listed for sale (oh, and we captured it in our photo with Oscar without even realizing it until I started going through the photos to make this blog).

The painting was made by the wife of the owner of the gallery. We asked if she’d consider selling it because we were both just drawn to this painting. So, Mario (another artist in the gallery) called up the owner and inquired. Next thing you know, we’re trying to figure out how we’re going to get it on the plane back to Los Angeles. We made the purchase and made arrangements to come back for the painting after we had walked around the art walk.

We went about the walk, enjoying every minute; making new friends and even bumping into old friends at the Parish. My wife and I had such a wonderful experience at the Parish last time, we decided to go back and check it out. This time there was an evening service taking place. I waited outside with the two coffees while my wife went inside. As the service ended, out came a dear friend, Carmina, who I met for the first time about 10 years ago while running the Steinhausen watch company.

Cabo Parish at night

We walked around a bit, shared some churros, and talked about life while enjoying some more beautiful artwork. As we were walking along the art displays in the square, I heard someone say “Señor. Señor”. I looked over and someone was trying to get my attention. He succeeded! “You just bought a painting from my gallery,” he said.

Francisco the Finger Painter

It took me a few seconds to put it together that he was the owner of the gallery where my wife and I had just purchased his wife’s painting. I stood in amazement at what a wonderful experience the entire night was as I spoke with Francisco about how much his wife’s painting had captured my heart. He told me he was so glad to hear this because his wife wasn’t sure if she ever wanted to sell it. He told her that if she ever did, the right person would come along at the right time. The painting had been through three hurricanes and was nearly 10 years old, and now we were blessed to have this treasured piece of work coming home with us!

Of course, we would have to find our car and get the painting back to Los Angeles. We said goodnight to my friend Carmina and then went back to pickup the painting. Then the adventure began. We had a good idea where we parked, so we started walking (painting in hand) in that direction. A few wrong turns later, and we quickly realized we had no idea where we had parked! I stood at a corner near the Parish and pulled up a photo I had taken of our car when we parked. I pulled up the GPS location and started to chuckle as I walked passed by wife and said: Donde está la biblioteca?

My wife looked at me puzzled.

Donde está la biblioteca?

“What does that even mean?” She asked. She definitely shouldn’t watch the Deadpool video!

We walked block after block holding hands as I kept saying “Donde está la biblioteca”. A few minutes later, we were back at our car, which was parked where? You guessed it! En la biblioteca!

20190120_212154000_ios