I’m trying to generate a pdf from a HTML with a javascript in it via a java spring endpoint

The code works and generates the pdf, but only the static html part and not the javascript generated chart:

<!-- report.html -->
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.min.js"></script> 

</head>
<p>this is chart</p>
<body>
<div style="width: 800px; height: 400px;">
    <canvas id="barChart"></canvas>
</div>

<script type="text/javascript" src="/static/js/ChartInitialization.js"></script>

</body>
</html>

Here is the script, which is working fine with the HTML when opened in the browser and it generates the chart correctly:


var barData = [10, 20, 30, 40, 50];


var barChart = new Chart(document.getElementById('barChart').getContext('2d'), {
    type: 'bar',
    data: {
        labels: ['Label 1', 'Label 2', 'Label 3', 'Label 4', 'Label 5'],
        datasets: [{
            label: 'Bar Chart',
            data: barData,
            backgroundColor: 'rgba(75, 192, 192, 0.2)',
            borderColor: 'rgba(75, 192, 192, 1)',
            borderWidth: 1
        }]
    },
});

Here is the controller code:

package com.example.chartjs.controllers;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import org.xhtmlrenderer.pdf.ITextRenderer;
import org.springframework.beans.factory.annotation.Autowired;
import org.thymeleaf.TemplateEngine;
import org.thymeleaf.context.Context;

import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;

@Controller
@RequestMapping("/pdf")
public class PDFController {

    @Autowired
    private TemplateEngine templateEngine;

    @GetMapping("/generate")
    public void generatePDF(HttpServletResponse response) {
        Context context = new Context();


        String htmlContent = templateEngine.process("report", context);

        ByteArrayOutputStream os = new ByteArrayOutputStream();

        try {
            ITextRenderer renderer = new ITextRenderer();
            renderer.setDocumentFromString(htmlContent);
            renderer.layout();
            renderer.createPDF(os, false);
            renderer.finishPDF();
        } catch (Exception e) {
            e.printStackTrace();
        }

        response.setContentType("application/pdf");
        response.setHeader("Content-Disposition", "attachment; filename=report.pdf");

        try (OutputStream out = response.getOutputStream()) {
            os.writeTo(out);
            os.flush();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

I’m not sure if the javascript code is executing after the generation of the pdf, or is there some other issue.

Is there a better way to implement setTimeout() than this?

typingEffect() iterates through an array of strings that type out on the screen like a chatbot. I originally put typedMessage.textContent = ""; inside typingFunction() to simplify things, but it was really hard to time the clearing text feature with how long some of the strings are.

I tried to change the timing around, but because the loop function can only be set to one set time(I think), I couldn’t make it work.

Is there a better way to write this so it’s more repeatable, while being able to manipulate the timing of the typedMessage.textContent = "";. Any help is greatly appreciated!

const body = document.querySelector("body");
const typedMessage = document.querySelector("div");
const messageArray = ["Welcome to your new chatBuddy!", "I want to ask you a few questions...", 
                      "Some of them might be kind of weird..", "But, hey... we're pals, right?!", 
                      "After all, my name is ChatBuddy, so...let's do this!", "Would you rather have no arms or no legs?"];

/**
 * function typingEffect()
 * iterates through messageArray[] to type out messages
 * setTimeout feature to iterate through characters/clear text
 * @param {string} message 
 * @param {string} item
 * @param {integer} i 
 * @returns 
 */
    const typingEffect = (message, item, i = 0) => {
    message.textContent += item[i];
    if (i === item.length - 1) {
        return;
    }
    setTimeout(() => { 
        typingEffect(message, item, i + 1)
    }, 30);
}

typingEffect(typedMessage, messageArray[0]);
setTimeout(() => {
    typedMessage.textContent = "";
}, 3000)
setTimeout(() => {
    typingEffect(typedMessage, messageArray[1]);
}, 3100)
setTimeout(() => {
    typedMessage.textContent = "";
}, 7000)
setTimeout(() => {
    typingEffect(typedMessage, messageArray[2]);
}, 7100)
setTimeout(() => {
    typedMessage.textContent = "";
}, 11000)
setTimeout(() => {
    typingEffect(typedMessage, messageArray[3]);
}, 11100)
setTimeout(() => {
    typedMessage.textContent = "";
}, 15000)

Issue with npx expo start react native

Hello all I have a problem when I launch npx expo start, this is the result of the command :
Starting project at C:UsersagresDesktopCodingReactNativeAwesomeProject
TypeError: Cannot read properties of undefined (reading ‘cacheStores’)
TypeError: Cannot read properties of undefined (reading ‘cacheStores’)
at C:UsersagresDesktopCodingReactNativeAwesomeProjectnode_modulesmetro-configsrcloadConfig.js:90:20
at Array.reduce ()
at mergeConfig (C:UsersagresDesktopCodingReactNativeAwesomeProjectnode_modulesmetro-configsrcloadConfig.js:85:18)
at loadMetroConfigFromDisk (C:UsersagresDesktopCodingReactNativeAwesomeProjectnode_modulesmetro-configsrcloadConfig.js:176:10)
at async loadConfig (C:UsersagresDesktopCodingReactNativeAwesomeProjectnode_modulesmetro-configsrcloadConfig.js:255:25)
at async Object.loadAsync (C:UsersagresDesktopCodingReactNativeAwesomeProjectnode_modules@expometro-configbuildExpoMetroConfig.js:31 6:10)
at async loadMetroConfigAsync (C:UsersagresDesktopCodingReactNativeAwesomeProjectnode_modules@expoclibuildsrcstartservermetroins tantiateMetro.js:47:18)
at async Object.instantiateMetroAsync (C:UsersagresDesktopCodingReactNativeAwesomeProjectnode_modules@expoclibuildsrcstartserverm etroinstantiateMetro.js:75:57)
at async MetroBundlerDevServer.startImplementationAsync (C:UsersagresDesktopCodingReactNativeAwesomeProjectnode_modules@expoclibuild srcstartservermetroMetroBundlerDevServer.js:233:66)
at async MetroBundlerDevServer.startAsync (C:UsersagresDesktopCodingReactNativeAwesomeProjectnode_modules@expoclibuildsrcstartserv erBundlerDevServer.js:88:24)
at async DevServerManager.startAsync (C:UsersagresDesktopCodingReactNativeAwesomeProjectnode_modules@expoclibuildsrcstartserverDe vServerManager.js:162:13)
at async startAsync (C:UsersagresDesktopCodingReactNativeAwesomeProjectnode_modules@expoclibuildsrcstartstartAsync.js:125:5)

Do you know what’s the problem here ?

npx expo start but i have an error

Azure Function Timer Trigger: Timeout Error When Accessing and Dequeuing Queue in Javascript

I have an Azure Function that is triggered by a timer every 5 minutes. This function is designed to access and dequeue messages from an Azure Service Bus Queue. However, I’m encountering a timeout error when the function attempts to dequeue messages, and I’m having trouble resolving it.

\ function.json
{
  "bindings": [
    {
      "name": "myTimer",
      "type": "timerTrigger",
      "direction": "in",
      "schedule": "0 */5 * * * *"
    }
  ]
}
\ index.js

const { ServiceBusClient } = require("@azure/service-bus");

module.exports = async function (context, myTimer) {
  try {
    var timeStamp = new Date().toISOString();
    const serviceBusClient = new ServiceBusClient(
      "myConnectionString"
    );

    const receiver = serviceBusClient.createReceiver("contacts", {
      receiveMode: "receiveAndDelete",
    });

    for await (let message of receiver.getMessageIterator()) {
      // your code here
      context.log(message);
    }
    context.log("Timer function processed request at", timeStamp);
  } catch (error) {
    context.log.error(error);
    context.res = {
      status: 500,
      body: "Internal Server Error",
    };
  }
};

The issue I’m facing is that the function times out when trying to access the queue and dequeue messages, especially if there are many messages in the queue. I suspect that the function may not be completing within the timeout window.

What can I do to address this timeout issue and ensure my Azure Function successfully processes messages from the queue every 5 minutes? Are there any optimizations or best practices that I should be following to handle potential timeout scenarios?

Any help or guidance would be greatly appreciated. Thank you!

how to secure this message functionality based on post and user id?

I’m totally into web dev, so I’m not sure if I should even name this issue “architectural”. Lemme explain it

So I’m working on a car marketplace website where both buyers and sellers will come. users can create posts about their cars and anyone can send messages to that seller about any post he (seller) created. but I don’t wanna make it like a social media where anyone can message anyone for no reason. so I wanted to create the message functionality based on two variables. one is the post id, and another is the user (message receiver) id. So if User_1 wants to chat with User_2, they need to chat about some post that was created by either User_1 or User_2. and besides that, if I use two variables in the message functionality, it would be easy for me to always show which post they’re talking about at the top of their inbox.

At first, I thot to create the inbox link like the following: /inbox/<POST_ID>/<MESSAGE_RECEIVER_ID>. but in this case, we have a issue

Let’s say we have three users

  1. User_1
  2. User_2
  3. The_naughty_user

Now let’s say, User_1 created a post with the post id of “Post_id“. so to contact User_1 about “Post_id“, the inbox link would be: /inbox/Post_id/User_1

Now if The_naughty_user gets the id of User_2, he can do /inbox/Post_id/User_2 and get into User_2‘s inbox, which obviously we don’t want.

We can check if <MESSAGE_RECEIVER_ID> is the author of <POST_ID> and terminate the process if not. but in that case, the seller won’t be able to send messages to the possible buyer (cuz the Possible Buyer is not the author of the post)

Now you can suggest not showing the IDs in the link and passing those in some other ways or encrypting them. but what I can think of is, showing or not showing the IDs isn’t even the issue. even if we encrypt the IDs, and pass those in some other ways other than by the link, The_naughty_user just needs to swap the encrypted IDs

I don’t know if I was clear enough. If yes, can u think of any possible solution to this problem? And if not, let me know what more info I can provide to help u understand the problem more

Tech: NextJS

`OnTrack` method not firing in WebRtc go server

  • I trying to make website in which there is WebRtc connection between client and server.Client is written in javascript and server is written in go. I have made code for sdp exchange and it is working great. I can tell as I have opened a dataChannel between them and it is sending message.

  • Now I am trying to send video from client to server. SDP exchange is successfull and I can see detail about video in my sdp send from client to server but my OnTrack method is not firing.

  • I want to able to recive the video from client and without that I cannot.

  • I have provided the important code but just in case if I am missing something here is the project github.

  • This is how i defined my webrtc object in go. Here OnDataChannel method is working fine. Below line of code is in starting of the main function and yes I am using http.
    `

    config := webrtc.Configuration{
        ICEServers: []webrtc.ICEServer{
            {
                URLs: []string{"stun:stun.l.google.com:19302"}, // STUN server for NAT traversal
            },
        },
    }

    api := webrtc.NewAPI(webrtc.WithMediaEngine(&webrtc.MediaEngine{}))

    var errPeerConnection error
    peerConnection, errPeerConnection = api.NewPeerConnection(config)
    if errPeerConnection != nil {
        fmt.Println("Error in creating peerConnection")
        return
    }
    peerConnection.OnTrack(func(tr *webrtc.TrackRemote, r *webrtc.RTPReceiver) {
        fmt.Println("Recived Stream from web")
    })
    // Data Channel
    peerConnection.OnDataChannel(func(ch *webrtc.DataChannel) {
        dc = ch
        dc.OnMessage(func(msg webrtc.DataChannelMessage) {
            fmt.Println("Message From Client" + string(msg.Data))
        })
        dc.OnOpen(func() {
            fmt.Println("Data Channel from client is opened")
        })
    })
    peerConnection.OnICECandidate(func(i *webrtc.ICECandidate) {
        fmt.Printf("found new ICE: %vn", i)
    })

  • this is How i defined my sdp exchange.
func connectWebrtc(w http.ResponseWriter, r *http.Request) {
    var offer webrtc.SessionDescription
    err := json.NewDecoder(r.Body).Decode(&offer)
    if err != nil {
        http.Error(w, "Invalid SDP offer", http.StatusBadRequest)
    }
    fmt.Println(offer)

    // Exchanging of sdp
    setRemoteErr := peerConnection.SetRemoteDescription(offer)
    if setRemoteErr != nil {
        fmt.Printf("Error in Setting Remote Descriptionn%vn", setRemoteErr)
        http.Error(w, "Error in Setting Remote Description", http.StatusInternalServerError)
    }

    answer, errAnswer := peerConnection.CreateAnswer(nil)
    if errAnswer != nil {
        fmt.Printf("Failed to Create Answern%v n", err)
        http.Error(w, "Failed to Create Answer", http.StatusInternalServerError)
    }

    errSetLocal := peerConnection.SetLocalDescription(answer)
    if errSetLocal != nil {
        fmt.Printf("Failed to set LocalDescriptionn%v n", err)
        http.Error(w, "Failed to set LocalDescription", http.StatusInternalServerError)
    }

    answerJSON, errEncode := json.Marshal(answer)
    if errEncode != nil {
        fmt.Printf("Failed to encode SDP answern%v n", err)
        http.Error(w, "Failed to encode SDP answer", http.StatusInternalServerError)
        return
    }

    w.Header().Set("Content-Type", "application/json")
    _, err = w.Write(answerJSON)
    if err != nil {
        fmt.Printf("Failed to send SDP answern%v n", err)
        http.Error(w, "Failed to send SDP answer", http.StatusInternalServerError)
    }
}

How to get the value of a key in this array? [duplicate]

I want to get the value of ‘duration’. Using Javascript.

{
  "kind": "youtube#videoListResponse",
  "etag": "gu_ajdkkReVZqQviw8AiULbNyLI",
  "items": [
    {
      "kind": "youtube#video",
      "etag": "hGqdHqZmBDE7-dtv2rAdFABUtOk",
      "id": "uSkPqgnBmUk",
      "contentDetails": {
        "duration": "PT1M1S",
        "dimension": "2d",
        "definition": "hd",
        "caption": "false",
        "licensedContent": false,
        "contentRating": {},
        "projection": "rectangular"
      }
    }
  ],
  "pageInfo": {
    "totalResults": 1,
    "resultsPerPage": 1
  }
}

I didn’t find anything for this mode.

Node REPL : Latest Script file contents are not getting fetched using require method

While using node js repl to run run require command latest file changes are not getting captured.

OS => Windows 11
Node Version => 16.6.0

Let script.js has content

global.testObject = {};
testObject.cont = "This is sample 1";

After accessing the file in node repl using require('script.js'), the testObject is available in the repl.
Then after changing the file content say to

global.testObject = {};
testObject.cont = "This is an updated sample 2";

Running require('script.js') again. But the cont of testObject is not getting updated in repl.

Does anyone know the reason and how to make latest changes available in the repl using require.

Hiding Web Custom component’s Attribute value

I’m new to Native Javascript Web Component. I’ve created a Web Component

class Table extends HTMLElement {
  constructor() {
    super();
    this.root = this.attachShadow({ mode: "closed" });
    const clone = tableTamplate.content.cloneNode(true);
    this.root.append(clone);
  }

  static get observedAttribute() {
    return ["table-data"];
  }

  connectedCallback() {
    console.log("Table Component Attached");
    const table_data = this.getAttribute("table-data");
    console.log(JSON.parse(table_data));
  }

  attributeChangedCallback(name, oldVal, newVal) {
    if (oldVal != newVal) {
      switch (name) {
        case "table-data":
          break;
      }
    }
  }
}

Is there a way to hide the value of the attribute from Development Tools > Element. The reason for asking is that, I don’t want users to see the data I’m passing specially when there’s sensitive information on it.

[show data in attribute](https://i.stack.imgur.com/SkdB0.png)

I tried setting enumerable field from Object.defineProperty

[setting enumerable](https://i.stack.imgur.com/eBOuS.png)

but it I got an error.

[error on setting enumerable](https://i.stack.imgur.com/TQC5X.png)

Radius Measurement Unit

I am using below code.

google.maps.event.addListener(drawingManager, "overlaycomplete", function(event) {
   if(event.type == 'circle') {
      $('#radius').val(event.overlay.getRadius());
   }
} 

What is the measurement unit of this radius ?

why this recursion function continue when it’s supposed to finish?

so basically I have this recursive function that tries to log all the number less than 50 one by one.

when it reaches 0; it’s supposed to finish the function execution but somehow it would just add up the num parameter till it’s equal to 50.

I would be greatful if you explain this strange behaviour and the way to avoid it.

thanks.

you can watch the execution phases stpe by step in This site / (Just copy and paste it there.)

let iterator = function (num) {
  console.log(num);
  if (num === false) {return 1}
  
  if (num <= 50 && Math.sign(num) === 1) {
    iterator(num - 1)
  } else {
    iterator(false)
  }
}

iterator(50);

I tried to tweak the function using chatgb but I dont get the answer I’m looking for.

logical expression not working when used as a case value in a switch statement

I’m new to JavaScript and trying to build a simple box movements controlling project.

I’m trying to use a switch statement as an alternative to lines of if statements.

In my code, I added the keydown event listener, so as to affect the CSS sytles when the user presses a key on their keyboard. This is my code:

/** @format */

let box = document.getElementById("box");
document.addEventListener("keydown", handleKeyPress);
let verticalPosition = 0;
let horizontalPosition = 0;
let rotation = 0;
let key;
let stopHorizontalMovement;
let stopVerticalMovement;

function handleKeyPress(keyPressed) {
    key = keyPressed.code;

    switch (true) {
        /* For Vertical movement */
        case key === "ArrowDown": {
            verticalPosition = verticalPosition + 1;
            if (verticalPosition > 100) {
                verticalPosition = 100;
                /* Stop moving the box down when the edge meets the end of the viewport height */
            }
            break;
        }

        case key === "ArrowUp": {
            verticalPosition = verticalPosition - 1;
            if (verticalPosition < 0) {
                verticalPosition = 0;
                /* Stop moving the box down when the edge meets the start of the viewport height */
            }

            break;
        }

        /* For Horizontal movement */
        case key === "ArrowLeft": {
            horizontalPosition = horizontalPosition - 1;
            if (horizontalPosition < -40) {
                horizontalPosition = -40;
                /* Stop moving the box down when the edge meets the start of the viewport width */
            }
            break;
        }

        case key === "ArrowRight": {
            horizontalPosition = horizontalPosition + 1;
            if (horizontalPosition > 40) {
                horizontalPosition = 40;
                /* Stop moving the box down when the edge meets the end of the viewport width */
            }
            break;
        }

        /* For rotation of the box */

        case keyPressed.ctrlKey === true &&
            (key === "ArrowUp" || key === "ArrowRight"): {
            console.log("rotating");
            rotation = rotation + 30;
            break;
        }

        default:
        // break;
    }
  refresh();
}
function refresh() {
    box.style.top = verticalPosition + "vh";
    box.style.left = horizontalPosition + "vw";
    box.style.transform = "rotate(" + rotation + "deg)";
}
html,
body {
    width: 100%;
    height: 100%;
}

body {
    display: flex;
    justify-content: center;
    /* align-items: center; */
    background-color: rgb(6, 6, 65);
    position: relative;
    margin: 0;
}

#box {
    background-color: red;
    width: 20%;
    height: 0;
    padding-bottom: 20%;
    position: relative;
}
<div id="box"></div>
<script src="script.js"></script>

The code block that begins with the comment /* For rotation of the box */ was to rotate the box clockwise when the ctrl, ArrowUp, or ArrowRight keys are pressed simultaneously. But it doesn’t seem to work.

But when it was in the if statement, it does work:


if (
        keyPressed.ctrlKey === true &&
        (key === "ArrowUp" || key === "ArrowRight")
    ) {
        rotation = rotation + 30;
      }

I really want to do this with the switch statement. I’d appreciate if anyone can help out.

How to redirect the buyer to approval link paypal

I am integrating paypal payment to web application and i am using JS/React as client app and Java spring Boot as server backend application, I am able to create the order and to get a reponse:

{id=XXXXXXXXXXXX, status=CREATED, links=[{href=https://api.sandbox.paypal.com/v2/checkout/orders/XXXXXXXXXXXX, rel=self, method=GET}, {href=https://www.sandbox.paypal.com/checkoutnow?token=XXXXXXXXXXXX, rel=approve, method=GET}, {href=https://api.sandbox.paypal.com/v2/checkout/orders/XXXXXXXXXXXX, rel=update, method=PATCH}, {href=https://api.sandbox.paypal.com/v2/checkout/orders/XXXXXXXXXXXX/capture, rel=capture, method=POST}]}

but i do not know how to redirect the buyer to the approval page ???

Here is my code:

JavaScript:

 createOrder(data, actions, cartInfo) {

        const totalAmount = parseFloat(cartInfo.total).toFixed(2);

console.log('############### ', totalAmount);
        // Order is created on the server and the order id is returned
        return fetch("http://127.0.0.1:8102/paypal/create-order", {
            method: "POST",
            headers: {
                "Content-Type": "application/json",
            },
            // use the "body" param to optionally pass additional order information
            // like product skus and quantities
            body: JSON.stringify({
                intent: "CAPTURE",
                purchase_units: [
                    {
                        items: cartInfo.items,
                        amount: {
                            currency_code: 'CAD',
                            value: `${totalAmount}`,
                        },
                        return_url:"http://127.0.0.1:8102/paypal/create-order"
                    },
                ],
            }),
        })
        .then((response) => response.json()).catch(error => {
            console.log('ERROR: ', error);
        })
        .then((order) => {
            console.log('ORDER ID ', order.id);
            return order.id
        } )
    }
    onApprove(data, actions) {
        console.log('CREATE ORDER DATA ONAPPROVE: ', data);
        // Order is captured on the server
        return fetch("http://127.0.0.1:8102/paypal/capture-order", {
            method: "POST",
            headers: {
                "Content-Type": "application/json",
            },
            body: JSON.stringify({
                orderID: data.orderID
            })
        })
        .then((response) => {
            console.log('$$$$$$$ RESPONSE: ' , response);
            response.json();
        }
        );
    }

Backend code:

@PostMapping(value = "/create-order", produces = MediaType.APPLICATION_JSON_VALUE)
    public Object createOrder(HttpServletRequest request, @RequestBody String order) {

        RestTemplate restTemplate = new RestTemplate();
        String accessToken = "";
        try {
            accessToken = tokenHelper.generateAccessToken();
        } catch (JSONException e) {
            throw new RuntimeException(e);
        }

        HttpHeaders headers = new HttpHeaders();
        headers.set("Authorization", "Bearer " + accessToken);
        headers.add("Content-Type", "application/json");
        headers.add("Accept", "application/json");
        headers.setContentType(MediaType.APPLICATION_JSON);

        HttpEntity<String> entity = new HttpEntity<String>(order, headers);
        try {
            ResponseEntity<Object> response = restTemplate.exchange(baseUrl.concat("/v2/checkout/orders"), HttpMethod.POST, entity, Object.class);
            if (response.getStatusCode() == HttpStatus.CREATED) {
                log.info("ORDER CAPTURE");
                System.out.println("$$$ RESPONSE  BODY " + response.getBody());
                return response.getBody();
            } else {
                log.error("FAILED CAPTURING ORDER");
                return "Unavailable to get CAPTURE ORDER, STATUS CODE " + response.getStatusCode();
            }
        } catch (HttpClientErrorException ex) {
            log.error(ex.getMessage());
            return null;
        }

    }

Any help is much appreciated thanks.

Opening text file with node.js script

I’m trying to make a program that decodes base64 text.
But the problem is that I want it to happen when you open text file with node.js program compiled in pkg.

So basically my question is how to make program interact with file if the file is opened with this program.

I mean like this:

I tried googling it but I haven’t found any answers.

Interpolate array of SVG-Paths in svelte with d3.interpolateString

I want to use the tweened-store from svelte in combinatin with the interpolateString-function from d3. As in here: https://svelte.dev/repl/2e753fbb33514bb8b8f4c928cbb39c6c?version=4.2.0

However, I want to animate 5 svg-lines. I have two arrays of length 5 with svg-path definitions. When the user clicks on a button, I want to interpolate the path of the first element in the first array to the first element in the second array and so on…

To my knowledge I can’t create a top-level array of tweened-stores in svelte. So I thought I’d put each store in its own component which looks like this:

<script>
  import { tweened } from "svelte/motion";
  import { interpolateString } from "d3-interpolate";

  export let v;
  export let animated_path = tweened(null, {
    interpolate: interpolateString,
    duration: 1000,
  });

  $: animated_path.set(v);
</script>

<path d={$animated_path} fill="none" stroke="black" />

However, the paths update and show the new image. But they do not interpolate. Why is that?