inokawa / react-native-react-bridge

An easy way to integrate your React (or Preact/React Native Web) app into React Native app with WebView.
https://www.npmjs.com/package/react-native-react-bridge
MIT License
256 stars 18 forks source link

Expecting Unicode escape sequence \uXXXX. (1026:64) #182

Open SolankiYogesh opened 2 months ago

SolankiYogesh commented 2 months ago

Describe the bug Transformation failed in some cases with the error

To Reproduce

      <div class="w-50 width-100 position-relative">
      <div style="display: flex;
      position: absolute;
      bottom: calc(100% - 15px);
      width: calc(100% - 30px);
      justify-content: space-between;
      align-items: baseline;">
      <img id="signBuyerImage" ${Utility.isEmpty(data?.buyer_signature) ? `src="${data?.buyer_signature}"` : ''}  style="max-width: 171px;max-height: 60px;object-fit: contain;width:auto; visibility: ${Utility.isEmpty(data?.buyer_signature) ? 'visible' : 'hidden'};"  />
      <span id="signBuyerTime" style="">${
        Utility.isEmpty(data?.buyer_signature_timestamp)
          ? moment(data?.buyer_signature_timestamp).format('MM/DD/YYYY hh:mm A')
          : ''
      }</span>
      </div>
         <input id="signBuyer" disabled class="flex-input w-100">
         <label class="mb-5">Buyer</label>

         <input disabled  class="flex-input w-100">
         <label class="mb-5">Buyer</label>
      </div>
      <div class="w-50 width-100 position-relative">
      <div style="display: flex;
      bottom: calc(100% - 15px);
      width: calc(100% - 30px);
      position: absolute;
      justify-content: space-between;
      align-items: baseline;">
      <img id="signSellerImage" ${Utility.isEmpty(data?.seller_signature) ? `src="${data?.seller_signature}"` : ''} style="max-width: 171px;max-height: 60px;object-fit: contain;width:auto; visibility: ${Utility.isEmpty(data?.seller_signature) ? 'visible' : 'hidden'};"  />
      <span id="signSellerTime" style="">${
        Utility.isEmpty(data?.seller_signature_timestamp)
          ? moment(data?.seller_signature_timestamp).format('MM/DD/YYYY hh:mm A')
          : ''
      }</span>
      </div>
         <input id="signSeller" disabled class="flex-input w-100">   

         <label class="mb-5">Seller</label>

         <input disabled  class="flex-input w-100">
         <label class="mb-5">Seller</label>
      </div>
   </div>

image

Expected behavior A clear and concise description of what you expected to happen.

Platform:

Additional context Add any other context about the problem here.

SolankiYogesh commented 2 months ago

@inokawa bro i updated html code if you have solution please give me here

         const res = await bundle(filename, metroOptions);
         return metroTransformer.transform({
             ...args,
         src:  "export default String.raw`" +
          escape(res).replace(/\\([`$?])/g, '\\$1'),
         });
     }
 i tried here but not working
JJSLIoT commented 2 months ago

I started facing the same issue after upgrading from react-native 71.x to 72.x

hichemfantar commented 2 months ago

same issue here especially with expo-gl and three.js "react-native": "0.74.3",