Getting Module ‘”react-router-dom”‘ has no exported member ‘RouteComponentProps error when migrating to react-router v6

We are having legacy class based code for which we are trying to migrate to latest react router that is version 6. During migration we are getting this error, Module '"react-router-dom"' has no exported member 'RouteComponentProps. We have added withRouter wrapper to add the legacy support.

import { useLocation, useNavigate, useParams } from "react-router-dom";

function withRouter(Component) {
  function ComponentWithRouterProp(props) {
    let location = useLocation();
    let navigate = useNavigate();
    let params = useParams();
    return <Component {...props} router={{ location, navigate, params }} />;
  }

  return ComponentWithRouterProp;
}

export default withRouter;

Our class based component looks like this,

import { Route, RouteComponentProps, Routes } from "react-router-dom";

class App extends React.Component<{} & RouteComponentProps<{}>, IState> {
  constructor(props: RouteComponentProps<{}>) {
    super(props);
    this.state = {
       prop1: null
    };
  }
   
  componentDidMount() {
    if (this.props.location.pathname === "/test") {
      window.location.reload();
    }
  };

   
  render() {
     return (
          <Routes>
               <Route path="/test" element={<Test />} />
          </Routes>
     )
  }
 }
 
export default withRouter(App);

How do I fix this issue?

Error: Module build failed (from ./node_modules/vue-loader/dist/index.js)

I’m setting up a laravel project and see an error as below. I have no clue as to what the cause is. Please help identify a fix

ncaught Error: Module build failed (from ./node_modules/vue-loader/dist/index.js):
TypeError: Cannot read properties of undefined (reading 'styles')
    at Object.loader (D:Projectsamazing-ads-toolnode_modulesvue-loaderdistindex.js:96:34)
    at ./resources/js/components/AmzSkuSearchComponent.vue (app.js?id=1015a1c7a0a1d02c4d096e84f60ab811:132:7)
    at __webpack_require__ (app.js?id=1015a1c7a0a1d02c4d096e84f60ab811:232:42)
    at webpackContext (app.js?id=1015a1c7a0a1d02c4d096e84f60ab811:182:9)
    at eval (app.js:20:75)
    at Array.map (<anonymous>)
    at eval (app.js:20:14)
    at ./resources/js/app.js (app.js?id=1015a1c7a0a1d02c4d096e84f60ab811:18:1)
    at __webpack_require__ (app.js?id=1015a1c7a0a1d02c4d096e84f60ab811:232:42)
    at app.js?id=1015a1c7a0a1d02c4d096e84f60ab811:385:64
    at __webpack_require__.O (app.js?id=1015a1c7a0a1d02c4d096e84f60ab811:269:23)

I followed several of the SO posts

How to upgrade AWS EC2 instance type t2.medium to t3.medium?

I want to upgrade intance type T2.Medium to T3.Medium and follow the these steps.

  • Stop the instance.
  • Go to Instance Settings > Change Instance Type > t3.medium > Save.
  • then try to start the Instance again.

But it’s given me this type of error message –

**Failed to start the instance --instance-id--
Enhanced networking with the Elastic Network Adapter (ENA) is required for the 't3.medium' instance type. Ensure that your instance '--instance-id--' is enabled for ENA.**
**Failed to start the instance --instance-id--
Enhanced networking with the Elastic Network Adapter (ENA) is required for the 't3.medium' instance type. Ensure that your instance '--instance-id--' is enabled for ENA.**

How to fix this issue without losing any data?

Is S3 deleteObjects API synchronous?

I am developing one solution to delete multiple files from S3 at once. While doing so I encountered a S3 api that deleted multiple objects at the same time.

I have used promises to handle this operation as S3 returns callback.

    return new Promise((resolve, reject) => {
        s3.deleteObjects({
            Bucket: 'my-bucket',
            Delete: {
                Objects: keys
            }
        }, (err, data) => {
            if (err)
                return reject(err)
            console.log(data)
            return resolve(data)
        });
    });
}

This API returns all keys that have been deleted. However, when I went through some of the stack-overflow questions, it appears that this API might take some time to delete files physically.
But this is not the case every time. Somtimes it takes several milliseconds, minutes or hours.
Is this expected behavior of the API? If not is it synhronous or asynchronous.
PS: By sync/ async I mean file deletion operation and not the response of the API.

How Highlight IFC Model in Three.js with Raycasting

I want to create a IFC Loader with Three.js and i loaded the IFC file in the scene using Web-IFC-Three but how can i highlight the ifc model on mouse hover and get attributed of that part with three.js

i have tried using raycast in three.js but getting some error when try to highlight that model

How to implement search in the array of object using javascript

Need to implement the search the value includes or not in the array of object, if exists only filter the particular object to display. Here is my solution

let data = [
        {
            "name": "Human Capital Management (HCM)",
            "description": "data entry with automatic data syncing capabilities.",
            "listingType": "integration",
            "connectors": [
                {
                    "name": "oracle",
                    "description": "our global platform",
                    "companyName": "Oracle",
                },
                {
                    "name": "greenhouse",
                    "description": "our global platform",
                    "companyName": "greenhouse",
                }
            ]
        },
        {
            "name": "Applicant tracking system (ATS)",
            "description": "data entry with automatic data syncing capabilities.",
            "listingType": "integration",
            "connectors": [
                {
                    "name": "HiBob",
                    "description": "our global platform",
                    "companyName": "HiBob",
                },
                {
                    "name": "greenhouse",
                    "description": "our global platform",
                    "companyName": "greenhouse",
                }
            ]
        },
    ]

Search value is

let searchVal = 'Greenhouse'

filtering function

let responseData = []
        
        await Promise.all(data.map(async (value)=> {
            if(value.name.includes(searchVal)) {
                responseData.push(value)
            }

            if(value.listingType.includes(searchVal)) {
                responseData.push(value)
            }

            if(Array.isArray(value.connectors)) {
                let connectors = await filterConnection(value.connectors, searchVal)
                if(Array.isArray(connectors) && connectors.length > 0) {
                    responseData.push({
                        ...value,
                        connectors
                    })
                }
            }
        }))

        return responseData

Need to implement the search function with more efficient code, kindly suggest the solution.

Integrating Linear Regression in MERN Stack Application: Python or JavaScript?

I’ve developed a restaurant admin panel using the MERN stack (MongoDB, Express.js, React, Node.js) and am now looking to implement linear regression to forecast sales or predict customer flow based on historical data. The backend is entirely in Node.js, but I’m considering Python for the linear regression part due to its extensive libraries and support for data science (like NumPy, pandas, and scikit-learn).

My dilemma is whether to stick with JavaScript/Node.js to keep the stack consistent or to introduce Python into the mix for its superior machine learning capabilities. I am concerned about the potential complexity of integrating Python with the existing Node.js backend and how to manage communication between the two, if that’s the route I choose. On the other hand, I’m also considering the performance and the ease of implementation that Python’s libraries might offer for linear regression tasks.

I would appreciate insights on:

The feasibility and best practices for integrating Python for linear regression into a MERN stack application.
Potential challenges and solutions in managing communication between Node.js and Python if I go down that route.
Recommendations on JavaScript libraries that could handle linear regression effectively if staying within the JS ecosystem is advisable.

Ultimately, I’m looking for guidance on the optimal path forward for incorporating linear regression into my project, weighing the pros and cons of Python vs. JavaScript for this specific use case.

I initially explored implementing linear regression directly within Node.js, hoping to maintain a consistent technology stack. I experimented with a couple of JavaScript libraries, such as simple-statistics for basic statistical operations and mljs for more machine-learning-oriented tasks, expecting them to offer a straightforward way to apply linear regression models to my dataset.

From these libraries, I managed to implement a basic linear regression model in Node.js. My expectation was that this approach would not only suffice for the prediction accuracy I needed but also keep the application deployment and maintenance straightforward by avoiding cross-language integration.

However, the results were mixed. While I was able to develop and run the linear regression model, I encountered two main issues:

Performance and Scalability: The JavaScript solution worked for small datasets, but as I tried scaling up the data size to more closely mirror the real-world usage scenario of the restaurant admin panel, the performance did not meet my expectations. Processing times were longer than anticipated, and I started to worry about the scalability of this solution.

Feature Set and Ease of Use: Although the libraries I used provided the basic functionality for linear regression, I found them lacking in the breadth of features and the ease of advanced statistical analysis compared to what I knew was available in Python's ecosystem (e.g., scikit-learn). For instance, I wanted more sophisticated ways to handle model fitting, diagnostics, and validation to improve prediction accuracy, which seemed more readily accessible in Python libraries.

These experiences led me to consider Python as an alternative for implementing the linear regression part of my project, despite my initial intention to keep everything within the Node.js environment. The expectation here was not only about achieving better performance and scalability but also accessing a richer set of tools for data analysis and machine learning to enhance the functionality and accuracy of the predictions in my restaurant admin panel.

Setting server side cookies with next.js and nest.js

I am making a small application using Next.js and Nest.js. I’m making a /login call in my client and the server should return an HttpOnly Cookie. Then if the response is OK we redirect to the homepage, which requires the user to be authenticated. I think I have done this correctly but I’m not sure if I’m missing something as I can see the cookie in my network request’s response headers’. I was assuming that the cookie would be present in the request headers in my middleware, but without manually setting the cookie, none of this works.
Another reason I think I did this wrong is because in my browser’s console after logging in, if I write document.cookie; I can see the cookie.

Server:

  @Public()
  @HttpCode(HttpStatus.OK)
  @Post('signIn')
  async signIn(@Body() signInDto: SignInDto, @Res() response: Response) {
    const { access_token, role } = await this.authService.signIn(
      signInDto.username,
      signInDto.password,
    );
    response.cookie('jwt', access_token, {
      sameSite: 'lax',
      path: '/',
      secure: false,
      httpOnly: true,
    });
    response.send({ message: 'Authenciation Successful', role });
  }

Client:

const LoginPage = () => {
  // should we move this out to an api folder?
  async function handleSubmit(e: FormData) {
    "use server";

    // const formData = new FormData(e.get);
    const username = e.get("username");
    const password = e.get("password");

    const response = await fetch("http://localhost:8080/auth/signIn", {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      credentials: "include",
      body: JSON.stringify({ username, password }),
    });
    console.log("response in cookie ", response.headers.get("Set-Cookie"));
// without this I cannot see the cookie in the browser nor can I make the call on my homepage
    const setCookieHeader = response.headers.get("Set-Cookie");
    if (setCookieHeader) {
      const jwtToken = setCookieHeader.split(";")[0].split("=")[1];
      console.log("JWT Token:", jwtToken);
      cookies().set({ name: "jwt", value: jwtToken, secure: true, path: "/" });
    }

    // if (!response.ok) doesn't work investigate
    if (!response.ok) {
      console.log("Invalid username or password");
      // how can we display an error here without state?
      return;
    }

    // redirect to homepage on success
    redirect("/");
  }

Adding Music to Each HTML page using Javascript [closed]

I am quite new to this and learning from scratch. I am creating a website for my children and I would like to add music to my pages, but not only one, but a different song for each page.

I know this code, plays a song throughout my whole website

var audio = new Audio("C: path");
audio.play()

But what could I do to have a different song added to 4 HTML pages, lets say

I have done this

const pageAudioMap = { //defined an object to map page URLs to audio file

Issue with Predictive Search Add to Cart Button not working for first product result in Shopify Dawn Theme

I’m using Shopify Dawn theme.

In predictive search results, I want to add Quantity selector & Add to cart button beside the product listing.

For the first product result, tag is not showing, due to which I’m not able to add to cart the product. For rest product items, it works perfectly.

Store URL – https://demostore-theme.myshopify.com
Password – 123

Search with keyword – “de”

1st result – https://prnt.sc/vwKRqVRDTYS3
Console error – https://prnt.sc/M_8u_9O7Mm0e

For rest result – https://prnt.sc/DSWORL0h9FEY (works perfectly)

I have edited this code in predictive-search.liquid

{%- for product in predictive_search.resources.products -%}
  <li
    id="predictive-search-option-product-{{ forloop.index }}"
    class="predictive-search__list-item"
    role="option"
    aria-selected="false"
  >
    <a
      href="{{ product.url }}"
      class="predictive-search__item predictive-search__item--link-with-thumbnail link link--text"
      tabindex="-1"
    >
      {%- if product.featured_media != blank -%}
        <img
          class="predictive-search__image"
          src="{{ product.featured_media | image_url: width: 150 }}"
          alt="{{ product.featured_media.alt }}"
          width="50"
          height="{{ 50 | divided_by: product.featured_media.preview_image.aspect_ratio }}"
        >
      {%- endif -%}
      <div class="predictive-search__item-content{% unless settings.predictive_search_show_vendor or settings.predictive_search_show_price %} predictive-search__item-content--centered{% endunless %}">
        {%- if settings.predictive_search_show_vendor -%}
          <span class="visually-hidden">{{ 'accessibility.vendor' | t }}</span>
          <div class="predictive-search__item-vendor caption-with-letter-spacing">
            {{ product.vendor }}
          </div>
        {%- endif -%}
        <p class="predictive-search__item-heading h5">{{ product.title | escape }}</p>
        {%- if settings.predictive_search_show_price -%}
          {% render 'price', product: product, use_variant: true, show_badges: false %}
        {%- endif -%}
      </div>
    </a>

    <!-- Customization for Add to Cart -->
    <div class="quick-add no-js-hidden">
      {%- liquid
        assign section_id = section.id
        assign product_form_id = 'quick-add-' | append: section_id | append: product.id
        assign qty_rules = false
        if product.selected_or_first_available_variant.quantity_rule.min > 1 or product.selected_or_first_available_variant.quantity_rule.max != null or product.selected_or_first_available_variant.quantity_rule.increment > 1
          assign qty_rules = true
        endif
      -%}
      {%- if product.variants.size > 1 or qty_rules -%}
        <modal-opener data-modal="#QuickAdd-{{ product.id }}">
          <button
            id="{{ product_form_id }}-submit"
            type="submit"
            name="add"
            class="quick-add__submit button button--full-width button--secondary{% if horizontal_quick_add %} card--horizontal__quick-add animate-arrow{% endif %}"
            aria-haspopup="dialog"
            aria-labelledby="{{ product_form_id }}-submit title-{{ section_id }}-{{ product.id }}"
            data-product-url="{{ product.url }}"
          >
            {{ 'products.product.choose_options' | t }}
            {%- if horizontal_quick_add -%}
              <span class="icon-wrap">{% render 'icon-arrow' %}</span>
            {%- endif -%}
            {%- render 'loading-spinner' -%}
          </button>
        </modal-opener>
        <quick-add-modal id="QuickAdd-{{ product.id }}" class="quick-add-modal">
          <div
            role="dialog"
            aria-label="{{ 'products.product.choose_product_options' | t: product_name: product.title | escape }}"
            aria-modal="true"
            class="quick-add-modal__content global-settings-popup"
            tabindex="-1"
          >
            <button
              id="ModalClose-{{ product.id }}"
              type="button"
              class="quick-add-modal__toggle"
              aria-label="{{ 'accessibility.close' | t }}"
            >
              {% render 'icon-close' %}
            </button>
            <div id="QuickAddInfo-{{ product.id }}" class="quick-add-modal__content-info"></div>
          </div>
        </quick-add-modal>
      {%- else -%}
        <product-form data-section-id="{{ section.id }}">
          {%- form 'product',
            product,
            id: product_form_id,
            class: 'form',
            novalidate: 'novalidate',
            data-type: 'add-to-cart-form'
          -%}
            <!-- Qty Selection -->
            <div
              id="Quantity-Form-{{ section.id }}"
              class="product-form__input product-form__quantity{% if settings.inputs_shadow_vertical_offset != 0 and settings.inputs_shadow_vertical_offset < 0 %} product-form__quantity-top{% endif %}"
              {{ block.shopify_attributes }}
            >
              {% comment %} TODO: enable theme-check once `item_count_for_variant` is accepted as valid filter {% endcomment %}
              {% # theme-check-disable %}
              {%- assign cart_qty = cart | item_count_for_variant: product.selected_or_first_available_variant.id -%}
              {% # theme-check-enable %}

              <div class="price-per-item__container">
                <quantity-input class="quantity" data-url="{{ product.url }}" data-section="{{ section.id }}">
                  <button class="quantity__button no-js-hidden" name="minus" type="button">
                    <span class="visually-hidden">
                      {{- 'products.product.quantity.decrease' | t: product: product.title | escape -}}
                    </span>
                    {% render 'icon-minus' %}
                  </button>
                  <input
                    class="quantity__input"
                    type="number"
                    name="quantity"
                    id="Quantity-{{ section.id }}"
                    data-cart-quantity="{{ cart_qty }}"
                    data-min="{{ product.selected_or_first_available_variant.quantity_rule.min }}"
                    min="{{ product.selected_or_first_available_variant.quantity_rule.min }}"
                    {% if product.selected_or_first_available_variant.quantity_rule.max != null %}
                      data-max="{{ product.selected_or_first_available_variant.quantity_rule.max }}"
                      max="{{ product.selected_or_first_available_variant.quantity_rule.max }}"
                    {% endif %}
                    step="{{ product.selected_or_first_available_variant.quantity_rule.increment }}"
                    value="{{ product.selected_or_first_available_variant.quantity_rule.min }}"
                    form="{{ product_form_id }}"
                  >
                  <button class="quantity__button no-js-hidden" name="plus" type="button">
                    <span class="visually-hidden">
                      {{- 'products.product.quantity.increase' | t: product: product.title | escape -}}
                    </span>
                    {% render 'icon-plus' %}
                  </button>
                </quantity-input>
                {%- liquid
                  assign volume_pricing_array = product.selected_or_first_available_variant.quantity_price_breaks | sort: 'quantity' | reverse
                  assign current_qty_for_volume_pricing = cart_qty | plus: product.selected_or_first_available_variant.quantity_rule.min
                  if cart_qty > 0
                    assign current_qty_for_volume_pricing = cart_qty | plus: product.selected_or_first_available_variant.quantity_rule.increment
                  endif
                -%}
                {%- if product.quantity_price_breaks_configured? -%}
                  <price-per-item
                    class="no-js-hidden"
                    id="Price-Per-Item-{{ section.id }}"
                    data-section-id="{{ section.id }}"
                    data-variant-id="{{ product.selected_or_first_available_variant.id }}"
                  >
                    {%- if product.selected_or_first_available_variant.quantity_price_breaks.size > 0 -%}
                      {%- assign variant_price_compare = product.selected_or_first_available_variant.compare_at_price -%}
                      <div class="price-per-item">
                        {%- if variant_price_compare -%}
                          <dl class="price-per-item--current">
                            <dt class="visually-hidden">
                              {{ 'products.product.price.regular_price' | t }}
                            </dt>
                            <dd>
                              <s class="variant-item__old-price">
                                {{ variant_price_compare | money_with_currency }}
                              </s>
                            </dd>
                          </dl>
                        {%- endif -%}
                        {%- if current_qty_for_volume_pricing < volume_pricing_array.last.minimum_quantity -%}
                          {%- assign variant_price = product.selected_or_first_available_variant.price
                            | money_with_currency
                          -%}
                          <span class="price-per-item--current">
                            {{- 'products.product.volume_pricing.price_at_each' | t: price: variant_price -}}
                          </span>
                        {%- else -%}
                          {%- for price_break in volume_pricing_array -%}
                            {%- if current_qty_for_volume_pricing >= price_break.minimum_quantity -%}
                              {%- assign price_break_price = price_break.price | money_with_currency -%}
                              <span class="price-per-item--current">
                                {{- 'products.product.volume_pricing.price_at_each' | t: price: price_break_price -}}
                              </span>
                              {%- break -%}
                            {%- endif -%}
                          {%- endfor -%}
                        {%- endif -%}
                      </div>
                    {%- else -%}
                      {%- assign variant_price = product.selected_or_first_available_variant.price
                        | money_with_currency
                      -%}
                      {%- assign variant_price_compare = product.selected_or_first_available_variant.compare_at_price -%}
                      <div class="price-per-item">
                        {%- if variant_price_compare -%}
                          <dl class="price-per-item--current">
                            <dt class="visually-hidden">
                              {{ 'products.product.price.regular_price' | t }}
                            </dt>
                            <dd>
                              <s class="variant-item__old-price">
                                {{ variant_price_compare | money_with_currency }}
                              </s>
                            </dd>
                            <dt class="visually-hidden">
                              {{ 'products.product.price.sale_price' | t }}
                            </dt>
                            <dd>
                              <span class="price-per-item--current">
                                {{- 'products.product.volume_pricing.price_at_each' | t: price: variant_price -}}
                              </span>
                            </dd>
                          </dl>
                        {%- else -%}
                          <span class="price-per-item--current">
                            {{- 'products.product.volume_pricing.price_at_each' | t: price: variant_price -}}
                          </span>
                        {%- endif -%}
                      </div>
                    {%- endif -%}
                  </price-per-item>
                {%- endif -%}
              </div>
              <div class="quantity__rules caption no-js-hidden" id="Quantity-Rules-{{ section.id }}">
                {%- if product.selected_or_first_available_variant.quantity_rule.increment > 1 -%}
                  <span class="divider">
                    {{-
                      'products.product.quantity.multiples_of'
                      | t: quantity: product.selected_or_first_available_variant.quantity_rule.increment
                    -}}
                  </span>
                {%- endif -%}
                {%- if product.selected_or_first_available_variant.quantity_rule.min > 1 -%}
                  <span class="divider">
                    {{-
                      'products.product.quantity.minimum_of'
                      | t: quantity: product.selected_or_first_available_variant.quantity_rule.min
                    -}}
                  </span>
                {%- endif -%}
                {%- if page_titleroduct.selected_or_first_available_variant.quantity_rule.max != null -%}
                  <span class="divider">
                    {{-
                      'products.product.quantity.maximum_of'
                      | t: quantity: product.selected_or_first_available_variant.quantity_rule.max
                    -}}
                  </span>
                {%- endif -%}
              </div>
              {%- if product.quantity_price_breaks_configured? -%}
                <volume-pricing class="parent-display no-js-hidden" id="Volume-{{ section.id }}">
                  {%- if product.selected_or_first_available_variant.quantity_price_breaks.size > 0 -%}
                    <span class="caption-large">{{ 'products.product.volume_pricing.title' | t }}</span>
                    <ul class="list-unstyled no-js-hidden">
                      <li>
                        <span>{{ product.selected_or_first_available_variant.quantity_rule.min }}+</span>
                        {%- assign price = product.selected_or_first_available_variant.price | money_with_currency -%}
                        <span data-text="{{ 'products.product.volume_pricing.price_at_each' | t: price: variant_price }}">
                          {{- 'sections.quick_order_list.each' | t: money: price -}}
                        </span>
                      </li>
                      {%- for price_break in product.selected_or_first_available_variant.quantity_price_breaks -%}
                        {%- assign price_break_price = price_break.price | money_with_currency -%}
                        <li class="{%- if forloop.index >= 3 -%}show-more-item hidden{%- endif -%}">
                          <span>
                            {{- price_break.minimum_quantity -}}
                            <span aria-hidden="true">+</span></span
                          >
                          <span data-text="{{ 'products.product.volume_pricing.price_at_each' | t: price: price_break_price }}">
                            {{- 'sections.quick_order_list.each' | t: money: price_break_price -}}
                          </span>
                        </li>
                      {%- endfor -%}
                    </ul>
                    {%- if product.selected_or_first_available_variant.quantity_price_breaks.size >= 3 -%}
                      <show-more-button>
                        <button
                          class="button-show-more link underlined-link"
                          id="Show-More-{{ section.id }}"
                          type="button"
                        >
                          <span class="label-show-more label-text"
                            ><span aria-hidden="true">+ </span>{{ 'products.facets.show_more' | t }}
                          </span>
                        </button>
                      </show-more-button>
                    {%- endif -%}
                  {%- endif -%}
                </volume-pricing>
              {%- endif -%}
            </div>
            <!-- Qty Selection End -->

            <input
              type="hidden"
              name="id"
              value="{{ product.selected_or_first_available_variant.id }}"
              class="product-variant-id"
              {% if product.selected_or_first_available_variant.available == false %}
                disabled
              {% endif %}
            >

            <button
              id="{{ product_form_id }}-submit"
              type="submit"
              name="add"
              class="quick-add__submit button button--full-width button--secondary{% if horizontal_quick_add %} card--horizontal__quick-add{% endif %}"
              aria-haspopup="dialog"
              aria-labelledby="{{ product_form_id }}-submit title-{{ section_id }}-{{ product.id }}"
              aria-live="polite"
              data-sold-out-message="true"
              {% if product.selected_or_first_available_variant.available == false %}
                disabled
              {% endif %}
            >
              <span>
                {%- if product.selected_or_first_available_variant.available -%}
                  {{ 'products.product.add_to_cart' | t }}
                {%- else -%}
                  {{ 'products.product.sold_out' | t }}
                {%- endif -%}
              </span>
              <span class="sold-out-message hidden">
                {{ 'products.product.sold_out' | t }}
              </span>
              {%- if horizontal_quick_add -%}
                <span class="icon-wrap">{% render 'icon-plus' %}</span>
              {%- endif -%}
              {%- render 'loading-spinner' -%}
            </button>
          {%- endform -%}
        </product-form>
      {%- endif -%}
    </div>

    <!-- Customization for Add to Cart END -->
  </li>
{%- endfor -%}

The Add to Cart button should work properly for all the search result products (especilly the first product result).

How to Fix Invisible/Blank PDF Returned by Postman with 200 Status Code in Node.js?

Basically, I am calling one third-party api which gives an response like 200 with actual pdf that is visible on postman. Third party API Response –

And I have created one endpoint in aws lamda node js in that I am calling the same third-party api and returning data as it is and its showing 200 on postman. But blank pdf is showing in response.

Tried all below approaches –

  1. Using Arraybuffer way, And Postman response –
  2. Convert it into base64 data approach
  3. Returning “isBase64Encoded”: true

Table is showing weird in PDF if table width is more than pdf width using JsPDF Angular library

In html have text, table and plotly chart, but when i export pdf from HTMl then table is not showing with all column in PDF and also not showing Plotly chart using below code.

const doc = new jsPDF('p','pt','a4');
const specialElementHandlers = {
  '#editor': function (element, renderer) {
   return true;
  }
};
const pdfTable = this.conversationsEl.nativeElement;
doc.fromHTML(pdfTable, 10, 10, {
  width: 540,
  elementHandlers: specialElementHandlers,
}, ()=> {
  doc.save(`Report-${currentDate}` + '.pdf');
}, {
  top:10,
  bottom:10,
  left:10,
  right:10
});

Openlayers in laravel

i want to add openlayers in laravel frameworks but it always have an error like this:
openlayers:1 Uncaught TypeError: Failed to resolve module specifier “rbush”. Relative references must start with either “/”, “./”, or “../”.

and another error is like this:
Expected a JavaScript module script but the server responded with a MIME type of “text/html”. Strict MIME type
Expected a JavaScript module script but the server responded with a MIME type of “text/css”. Strict MIME type

can someone help me to fix and solve this so my openlayers and the map is shown webpage so the laravel frameworks is working after adding openlayers library?

thank you

solve this so my openlayers and the map is shown webpage so the laravel frameworks is working after adding openlayers library

Should I store pageSize as a global state or as an URL param?

Right now, pageSize is defined and being used in PersonItems (to set the items per page in a paginated list), which is inside PersonItemsWrapper. But I also need pageSize in PersonModal (to jump to the last pagination page when a new person is added), which is inside PersonAddControls.

<>
  <PersonItemsWrapper /> // PersonItems is inside
  <PersonAddControls /> // PersonModal is inside
</>

I could lift up the state and pass pageSize as a prop … but that means I’d have to pass it down two components. So there are only two other options:

a. Store pageSize in a store (e.g. Zustard)

b. Store pageSize as an URL param (e.g. https://localhost:3000/persons?pageSize?=10?page=8)

What’s the usual way of doing this?