How to use Google Recaptcha v3 with a Custom Image Submit Button?

I’m wondering if it’s possible to use recaptcha V3 with an image as the submission button. When I use this code, recaptcha loads just fine and submits a token:

<form id="test" method="post">
<input type="text" name="email" />
<input class="g-recaptcha" data-sitekey="[PublicKey]" data-callback='onSubmit' data-action='submit' type="submit" value="Submit me!" />
</form>
<script>function onSubmit(token){document.getElementById("test").submit();}</script>

However, recaptcha won’t load and doesn’t generate a token when using an image type input like this:

<form id="test" method="post">
<input type="text" name="email" />
<input class="g-recaptcha" data-sitekey="[PublicKey]" data-callback='onSubmit' data-action='submit' type="image" src="myButton.png" />
</form>
<script>function onSubmit(token){document.getElementById("test").submit();}</script>

I’m guessing that the button type is an issue. But is there a way around that, because I’d love to have a custom image button instead of a system button. Help? Thanks all!

How to build Atlaskit editor using React

I’m relatively new in React and I have problem with building simple Atlaskit editor. I’m trying to do this using Vite, here are the details:

// package.json
{
"name": "atlaskit-editor",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
    "dev": "vite",
    "build": "tsc && vite build",
    "lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
    "preview": "vite preview"
},
"dependencies": {
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "@atlaskit/editor-core": "^185.8.0"
},
"devDependencies": {
    "@types/react": "^18.0.37",
    "@types/react-dom": "^18.0.11",
    "@typescript-eslint/eslint-plugin": "^5.59.0",
    "@typescript-eslint/parser": "^5.59.0",
    "@vitejs/plugin-react": "^4.0.0",
    "eslint": "^8.38.0",
    "eslint-plugin-react-hooks": "^4.6.0",
    "eslint-plugin-react-refresh": "^0.3.4",
    "typescript": "^5.0.2",
    "vite": "^4.3.9"
}
}

Here App.tsx

// App.txs
import { Editor } from "@atlaskit/editor-core";
import "./App.css";

function App() {
    return (
        <>
            <div>
                <Editor />
            </div>
        </>
    );
}

export default App;

Main.tsx

import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App.tsx";
import "./index.css";

ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
    <React.StrictMode>
        <App />
    </React.StrictMode>
);

Index.tsx

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Vite + React + TS</title>
  </head>
  <body>
    <div id="root"></div>
    <script type="module" src="/src/main.tsx"></script>
  </body>
</html>

The output is blank page with the following error in the console:
enter image description here

Here is a simple example, could someone help to reproduce it?
https://atlaskit.atlassian.com/packages/editor/editor-core/example/basic

I keep getting a Unhandled Runtime Error saying SyntaxError: Unexpected end of JSON input. Can someone please tell me what is wrong?

I tried to replicate two different APIs in different projects and both give me the same error. I am really not sure what the problem is and if someone could guide me on what to fix I would really appreciate it.

Unhandled Runtime Error
SyntaxError: Unexpected end of JSON input

let result = await response.json();

Page.tsx file

"use client";

import { useState, useRef } from "react";
import { ReactSketchCanvas, ReactSketchCanvasRef } from "react-sketch-canvas";
import { FaUndo, FaTrash } from "react-icons/fa";




export default function Home() {

  const [prompt, setPrompt] = useState("");
  const [error, setError] = useState<string | null>(null);
  const [outputImage, setOutputImage] = useState<string | null>(null);



  const canvasRef = useRef<ReactSketchCanvasRef>(null);

  const handleUndo = () => {
    canvasRef.current!.undo();
  };

  const handleClear = () => {
    canvasRef.current!.clearCanvas();
  };

  const handleGenerate = async () => {
    // user need to provide prompt
    if (prompt === "") {
      alert("Please enter your prompt first!");
      return;
    }
  
    // convert sketch to base64
    const base64 = await canvasRef.current!.exportImage("png");
    console.log(base64);

    generateAIImage(base64);
  };

  const generateAIImage = async (base64image: any) => {
    const response = await fetch("/api/replicate", {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        image: base64image,
        prompt,
      }),
    });
  
    let result = await response.json();
    console.log(result);
  
    if (result.error) {
      setError(result.error);
      return;
    }
  
    setOutputImage(result.output[1]);
  };

  return (
    <div className="max-w-3xl mx-auto my-10 px-4">


      {/* Header Section */}
      <section className="flex items-center justify-center mb-10">

      <h1 className="font-semibold text-transparent text-5xl bg-gradient-to-r from-blue-600 via-green-500 to-yellow-400 inline-block bg-clip-text">
        Scribble For Fun
      </h1>

      </section>

      {/* Sketch Canvas Section */}
      <section className="w-[400px] h-[400px] mx-auto mb-16 mt-6">

        <div className="w-full aspect-square border-none">
            <ReactSketchCanvas
              ref={canvasRef}
              width="100%"
              height="100%"
              strokeWidth={4}
              strokeColor="#000000"
            />
        </div>

        <div className="flex items-center justify-between mt-2">
          <button 
          onClick={handleUndo}
          className=" text-gray-300 text-md flex items-center hover:scale-110 duration-300 hover:text-yellow-500">
            <FaUndo className="mr-2" /> Undo
          </button>

          <button className=" text-gray-300 text-md flex items-center hover:scale-110 duration-300 hover:text-red-500">
            <FaTrash 
            onClick={handleClear}
            className="mr-2" /> Clear
          </button>
        </div>

      </section>

      {/* Prompt Section */}
      <section className="w-[400px] flex items-center mx-auto">

      <input
        type="text"
        name="prompt"
        value={prompt}
        onChange={(e) => setPrompt(e.target.value)}
        className="rounded-l-lg py-3 px-4 w-full focus:outline-none text-black"
        placeholder="Enter your prompt here"
      />

      <button
      onClick={handleGenerate}
      className="rounded-r-lg py-3.5 px-4 ml-1 text-white bg-gradient-to-br from-yellow-400 to-red-600 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-green-200 dark:focus:ring-green-800 font-medium text-sm text-center">
        Generate
      </button>

      </section>

      {/* Output Image Section */}
      <section className="w-[400px] h-[400px] flex items-center justify-center mx-auto mt-12">
      {error && (
          <div className="flex justify-center">
            <p className="text-lg text-red-500">{error}</p>
          </div>
        )}

        {outputImage && (
            <img
              src={outputImage}
              className="object-cover w-full aspect-square rounded-lg mb-12"
            />
          )}
      </section>
    </div>
  );
}

route.ts file

import { NextResponse } from "next/server";
import Replicate from "replicate";

export async function POST(request: Request) {
  // 1. Get the request data (in JSON format) from the client
  const { image, prompt } = await request.json();

  // 2. Initialize the replicate object with our Replicate API token
  const replicate = new Replicate({
    auth: process.env.REPLICATE_API_TOKEN as string,
  });

  // 3. Set the model that we're about to run
  const model =
    "jagilley/controlnet-scribble:435061a1b5a4c1e26740464bf786efdfa9cb3a3ac488595a2de23e143fdb0117";

  // 4. Set the input image which is the image we uploaded from the client
  const input = {
    image,
    prompt,
    a_prompt: "best quality, extremely detailed",
    n_prompt:
      "longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality",
  };

  // 5. Run the Replicate's model (to remove background) and get the output image
  const output = await replicate.run(model, { input });

  // 6. Check if output is NULL then return error back to the client
  if (!output) {
    console.log("Something went wrong");
    return NextResponse.json(
      { error: "Something went wrong" },
      { status: 500 }
    );
  }

  // 7. Otherwise, we show output in the console (SERVER side)
  // and return output back to the client
  console.log("OUTPUT: ", output);
  return NextResponse.json({ output }, { status: 201 });
}

How to fetch url or param in NextJs 13 app directory

I am trying to port my getserversideprops() to next13 and need to use url. How do i fetch params(from the directory structure) or url. My path for the page is /posts/{postId}. This is the code I am trying to work with

'use client'

async function fetchOnePost() {
  // need to access URL path or param `{postId}` here
}

export default async function Page() {
    const postData = await fetchOnePost();

return(<>....</>);
} 

This is my directory structure leading to the file

app/
 - posts/
     - [postId]/
         - page.js

Basically I want the equivalent app directory code for this below code that is used in pages directory(/pages/post/[postId].js):

export async function getServerSideProps(context) {
  const { postId } = context.query;

  const something = somthingDoneWithPostId(postId)

  return { props: { something } };
}

How to iterate array on GeoJSON to draw polygon dynamically in react-leaflet

I’m currently working on project that user draw a polygon and save that data on SQL server and load that data from SQL to show on leaflet page.

What I did so far is, saving drawing data on sql server and load it, having this format.

const MapGeoInfo = () => {
    const [geoJsonData, setGeojsonData] = useState<any>([]);
    const [geoJsonKey, addToGeoJsonKey] = useState(1)

    useEffect(() => {
        const fetchData = async () => {
            const resp: any = await getGeoFenceMaster();
            const geoData = [];

            if (resp?.length > 0) {
                for (var i = 0; i < resp.length; i++) {
                    geoData.push([resp[i]['lng'], resp[i]['lat']]);
                }
            }

            var data = resp,
                hash = Object.create(null),
                result = data.reduce(function (r: any, a: any) {
                    if (!hash[a.type]) {
                        hash[a.type] = { type: a.type, data: [] };
                        r.push(hash[a.type]);
                    }
                    hash[a.type].data.push({ lat: a.lat, lng: a.lng });
                    return r;
            }, []);

            setTestval(data);
            setGeojsonData(geoData);
            addToGeoJsonKey(geoJsonKey + 1);
        };
        fetchData();
    }, []);
    
    return (
        <GeoJSON
            key={geoJsonKey}
            data={{
                "type": "Polygon",
                "coordinates": [geoJsonData],
            }}
            style={{ color: "#1FFFF9", weight: 4, opacity: 5 }}
        >
        </GeoJSON>
    )
};

export default MapGeoInfo;

So what I did first was, after getting data I made an array and store at “geoData” with push. But I just realized there’s no such thing to make difference each polygon and when I show it on GeoJson, it just showed like this.
All polygons are just connected

So I tried to make separate first on these data by type (name of each polygon) using hash following format.

(“type” would be the name of each polygon’s name.)

Now I think this data format would work and now I need to work on how to iterate this onto GeoJson.
I’m new to both react and leaflet so keep researching for a week now to work on this but still haven’t find any solution.

I’m thinking to use map() to iterate GeoJson and I’m working on it but not sure.

Get notified about comment replies via Instagram Graph API Web Hooks

In our solution we would like to get notified about new replies to an already existing comment. After investigating the Meta Developer Docs, we’ve figured out that we could use web hooks to get informed regarding new comments, however replies to existing comments were not explicitly mentioned. Trying it out requires our Instagram App to be verified during a review. That way we simply could try it out. Unfortunately our solution is still under development hence a review comes a little too early.

Do you know if it’s possible to use web hooks in order to get notified about new comment replies?

VSCode keeps freezing up for a few seconds, and I can’t understand the function call that’s hanging in Performance

I’m using VSCode with Remote Explorer to access a git repo on a server. In the past few weeks, it’s started hanging for 3-5 seconds something like once a minute, which is super annoying. I did a performance record using Toggle Developer Tools, and I caught a function call that’s hanging for 5000+ms. Unfortunately, I’m stumped looking at the code it points me too, as it’s pretty dense js, which I’m not super familiar with.

Performance graph

Function hanging for 5s

Garbage collection seems like a part of it, but not the whole delay

The function call is i.onload @ workbench.desktop.main.js:656:2301. From as much as I can tell, that just covers

this.i.onload=n=>{this.k=!1;const f=n.target.result;this.traceSocketEvent("read",f),this.a.fire(f),this.j.length>0&&s(this.j.shift())};

However, I can’t figure out what this is referencing, and what the problem might be. Does anyone have any idea what is going on here? Is there a better location I should be asking about this?

How can I add a logo to Mmenu?

I’d like to add a logo and a language switcher above my menu.
Social media right under the menu.

Someone with tips to accomplish this?

Expected markup:

  • Logo and language switcher
  • My Menu
  • Social media

I use drupal all content: logo, languages and social-media are dynamicly added.

this is my html:

<div id="mobile-menu" class="mobile-menu">
    <div class="mobile-menu--header">

        {% if page.header_logo %}
            {{ page.header_logo }}
        {% endif %}

        {% if page.lang %}
            {{ page.lang }}
        {% endif %}

    </div>

    {% include '@novsubtheme/menu/mobile--menu.html.twig' %}

    <div class="socialmedia">

     {% if page.social %}
            {{ page.social }}
        {% endif %}

    </div>
</div>

This is my mmenu.js

(function ($, Drupal) {
  'use strict';

  Drupal.behaviors.mmenu = {
    attach: function (context, setting) {
      $('#mobile-menu', context).once('mmenu').each(function () {

        const menu = new Mmenu(this, {
          'navbar': {
            add: false,
          },
          'extensions': [
            'effect-menu-slide',
            'position-left',
            'pagedim-black',
            'position-front',
          ],
          'page': {
            noSelector: '.mobile-menu--header'
          },
          'offCanvas': {
            position: 'right',
          },
        }, {
          classNames: {
            selected: 'is-active',
            fixedElements: {
              fixed: 'fixed',
            },
          },
        });

        var $menuIcon = $('#menu_icon');
        var api = menu.API;

        $menuIcon.on('click', function () {
          api.open();
        });
      });
    }
  }
})(jQuery, Drupal);

Autofill Amount and Description on donation site with URL

I’m currently working with a friend to do a donation drive and would like to know if there’s a way to autofill the donation page: https://www.convergepay.com/hosted-payments?ssl_txn_auth_token=4G8dYCJVTk%2BZ84twEiUlHgAAAX6SchrL

with specific amount and description

I tried adding adding &ssl_amount=100 to the url but doesn’t seem to work
https://www.convergepay.com/hosted-payments?ssl_txn_auth_token=4G8dYCJVTk%2BZ84twEiUlHgAAAX6SchrL&ssl_amount=100

Indesign Script – Keep reference of nested pageItem in group while duplicating it

I am on InDesign 2023. VisualStudioCode.

I have a group of nested textFrames. I track the textFrames by their id.
Now i need to duplicate these groups but still keep track of the textFrame duplicates.

Example:
Let’s say i have a group of pageItems (can be deeply nested and/or anchored):

  • Rectangle with id 1
  • TextFrame with id 2
  • TextFrame with id 3
  • (and many more)

I need to insert text in TextFrame with id 2. No problem by getting it by id.

Now i need to duplicate the wrapping group to a new location. No Problem too. On duplicating, the id of the textFrame inside the group changes and i obviously loose my reference of it.

So what i do is to use the label of the textFrame to store the id as string and recursively look for that in the duplicated group. This way i can identify the duplicated textFrame and continue using it, but is very slow for large groups and tons of duplicates.

So i was wondering if there’s a more efficient way of accomplishing this task to keep a reference of a nested page Item in a group while duplicating it.

Any help appreciated.

Why my Mongo database is not responding in my first request?

For contextualization, i am doing it using NodeJS and mongoose, and i have two models in my mongo database: User and Product.

I am trying to update my user in theese two models (an user have many products and a product have one owner {user})
But when i call the request, it only updates the user model, and the product model keeps showing the old user infos.

Here is the code:

//USER CONTROLLER//
 static async ChangeUser(req, res) {
    
    const {name, password, email, location} = req.body

    const changesToDo = {
        name, 
        password,
        email,
        location
    }
    const user = await UserBusiness.GetUserByToken(req)
    if(user.status) {
        res.status(user.status).json({message: user.msg})
    }

    const changedUser = await UserBusiness.ChangesToDo(changesToDo, user)
    if(changedUser.status) {
        res.status(changedUser.status).json({message: changedUser.msg})
    }

    return res.status(200).json({message: "Alterações concluídas", user: changedUser})
}

//USER BUSINESS//

static async ChangesToDo(changes, user) {

    if(!changes.name || changes.name.trim() == "") {
        changes.name = user.name
    }
    if(await this.UserExists(changes.email)) {
        return new EndMsg(400, "Email já está em uso")
    }
    if(!changes.email || changes.email.trim() == "") {
        changes.email = user.email
    }

    const pwdCompare = await bcrypt.compare(changes.password, user.password)

    if(pwdCompare || !changes.password || changes.password.trim() == "") {
        changes.password = user.password
    } else {
        const salt = bcrypt.genSaltSync(12)
        const hash = bcrypt.hashSync(changes.password, salt)
        changes.password = hash
    }
    if(!changes.location || changes.location.trim() == "") {
        changes.location = user.location
    }

    const updateUser = await UserRepository.UpdateUser(changes, user)
    if(updateUser.status) {
        return new EndMsg(updateUser.status, updateUser.msg)
    }
    return updateUser
}

  
   ///USER REPOSITORY///
   static async UpdateUser(changes, user) {

    try {
        const update = await User.findByIdAndUpdate(user._id, {name: changes.name, password: changes.password, email: changes.email, location: user.location})                      
        if(!update) {
            return new EndMsg(400, "Nao foi possível alterar os dados")
        }

        const otherUpdates = await Product.updateMany({'owner._id': user._id}, {owner: user})

        
        console.log(otherUpdates)
        return update
    }catch(err) {
        console.log(err)
        return new EndMsg(500, err)
    }
}

Note: I am not receiving any error message and it really updates. But only when i call the request for the secound time

chartjs tooltip position out of bounds based on scroll position

I am using chartjs with the CoreUI Angular dashboard template. I have added a horizontal scroll bar for a line chart that contains a lot of data. The horizontal scroll works fine, and the chart displays nicely but the tooltip will display out of bounds based on where the scrollbar is. So, if the scroll bar hasn’t been moved, the tooltip is in the correct position by the point that the cursor in near, but the farther you move the scroll bar, the farther the tooltip will be to the right of the point pushing it out of bounds and creating a scroll bar for the entire webpage.

Before scrolling, tooltip is at correct location.
no scroll

Scrolling to end, hovering over one of the last points, tooltip is all the way to the right, creating additional whitespace that shouldn’t be there
end scroll

Chart HTML

<div style="width: 100%; overflow-x: auto;">
  <c-chart 
    [data]="timestampChartData"
    [options]="chartOptions.options"
    type="line" 
    height="600"
    width="3000"
 />
</div>

Chart options

export const chartJsOptions: any = {
  options: {
    maintainAspectRatio: false,
    interaction: {
      intersect: false,
      mode: 'index',
    },
    plugins: {
      legend: {
        display: false
      },
    }
  },
  style: {
    backgroundColor: 'rgba(151, 187, 205, 0.2)',
    borderColor: 'rgba(151, 187, 205, 1)',
    pointBackgroundColor: 'rgba(151, 187, 205, 1)',
    pointBorderColor: '#fff',
    pointStyle: 'circle',
    pointRadius: 5,
  }
}

Adding another Javascript filtering section to working code

@Developer helped me with getting a filter system working using JavaScript. I’m having trouble with the last part of the JavaScript under “Default”. What I’m trying to do is add another checkbox group called “Category” to add one more additional filter, but I’m not sure how to code the ‘else if’ part. Below is my working code. I dont want to change anything aside from getting the new group working. Can someone help please? Thanks!

const filterCheckboxes = document.querySelectorAll('.filter-checkbox');
const colorCheckboxes = document.querySelectorAll('.color-checkbox');
const sizeCheckboxes = document.querySelectorAll('.size-checkbox');
const priceCheckboxes = document.querySelectorAll('.price-checkbox');
const categoryCheckboxes = document.querySelectorAll('.category-checkbox');
const filterables = document.querySelectorAll('.filterable');

function getCheckedValues(checkboxes) {
  return Array.from(checkboxes)
    .filter(checkbox => checkbox.checked)
    .map(checkbox => checkbox.value);
}

function updateFilter() {
 let level = 0;

 const colorChecked = getCheckedValues(colorCheckboxes);
 // If there is any Color Checkbox
 if (colorChecked.length) level++;

 const sizeChecked = getCheckedValues(sizeCheckboxes);
 // If there is any Size Checkbox
 if (sizeChecked.length) level++;

 const priceChecked = getCheckedValues(priceCheckboxes);
 // If there is any price Checkbox
 if (priceChecked.length) level++;
    
const categoryChecked = getCheckedValues(categoryCheckboxes);
 // If there is any category Checkbox
 if (categoryChecked.length) level++;

 if (!level) {
   filterables.forEach(filterable => {
     filterable.style.display = 'block';
   })
   return;
 }

 filterables.forEach(filterable => {
   const colors = filterable.dataset.colors.split(' ');
   switch (level) {
     case 1:
       // if this case, it means that only one filter is selected
       if (colorChecked.includes(colors[0]) || sizeChecked.includes(colors[1]) || priceChecked.includes(colors[2]) || categoryChecked.includes(colors[3])) {
          filterable.style.display = 'block';
       } else {
          filterable.style.display = 'none';
       }
       break;
     case 3:
       // Case 3 means that all filters are selected
       if (colorChecked.includes(colors[0]) && sizeChecked.includes(colors[1]) && priceChecked.includes(colors[2]) && priceChecked.includes(colors[3])) {
          filterable.style.display = 'block';
       } else {
         filterable.style.display = 'none';
       }
       break;
     default:
       // Default means that two filters are seleted
       if (colorChecked.length >= 1 && sizeChecked.length >= 1) {
         if (colorChecked.includes(colors[0]) && sizeChecked.includes(colors[1])) {
            filterable.style.display = 'block';
         } else {
            filterable.style.display = 'none';
         }
        } else if (colorChecked.length >= 1 && priceChecked.length >= 1) {
           if (colorChecked.includes(colors[0]) && priceChecked.includes(colors[2])) {
                filterable.style.display = 'block';
           } else {
                filterable.style.display = 'none';
           }
         } else {
           if (sizeChecked.includes(colors[1]) && priceChecked.includes(colors[2])) {
              filterable.style.display = 'block';
            } else {
                filterable.style.display = 'none';
            }
          }
          break;
        }
      });
}

filterCheckboxes.forEach(checkbox => {
   checkbox.addEventListener('change', updateFilter);
});

updateFilter(); // initial filter based on default checkbox state    
    
<div>
    <h3>Color</h3>
    <label><input type="checkbox" class="filter-checkbox color-checkbox" value="red">Red</label>
    <label><input type="checkbox" class="filter-checkbox color-checkbox" value="green">Green</label>
    <label><input type="checkbox" class="filter-checkbox color-checkbox" value="blue">Blue</label>
  </div>
  <div>
    <h3>Size</h3>
    <label><input type="checkbox" class="filter-checkbox size-checkbox" value="small">Small</label>
    <label><input type="checkbox" class="filter-checkbox size-checkbox" value="medium">Medium</label><label>
      <input type="checkbox" class="filter-checkbox size-checkbox" value="large">Large</label>
  </div>
  <div>
    <h3>Price</h3>
    <label><input type="checkbox" class="filter-checkbox price-checkbox" value="10">$10</label>
    <label><input type="checkbox" class="filter-checkbox price-checkbox" value="20">$20</label><label>
      <input type="checkbox" class="filter-checkbox price-checkbox" value="30">$30</label>
  </div>
    <div>
    <h3>Category</h3>
    <label><input type="checkbox" class="filter-checkbox category-checkbox" value="a">A</label>
    <label><input type="checkbox" class="filter-checkbox category-checkbox" value="b">B</label><label>
      <input type="checkbox" class="filter-checkbox category-checkbox" value="c">C</label>
  </div>
  <div>
    <br>
    <hr>
    <h1>Filtered Result</h1>
    <div class="filterable" data-colors="blue large 30 b">Product One</div>
    <div class="filterable" data-colors="green small 10 a">Product Two</div>
    <div class="filterable" data-colors="red medium 20 c">Product Three</div>
    <div class="filterable" data-colors="red large 30 a">Product Four</div>
  </div>

Couldn’t connect from other IP to website only one IP and Virtual server can connect like whitelist

I have virtual server VDS, using to host game server and website my website was working for everyone until yesterday I made some changes with website but I’m pretty sure I’m not using any whitelist on it somehow only my home IP can connect to website and Virtual Server’s IP others like my friends and anyone with other IP couldn’t, also I didn’t made any changes in Domain web and in Cloudflare settings so there is no any whitelist too what to do to make my website viral, also it isn’t about VPN or something I checked everything made my friends to use VPN or something anyways if there was my country blocking this website because it is hosted in Germany and I’m from Georgia but it also don’t work please help me with it

I told about what I tried in my question

Unable to get css module and execute application using rollup.js and react

Hi I am trying to create a react plugin using rollup which will be used locally instead of publishing to npm . I was able to create the plugin but the problem is i unable to generate the css (Which are in modules example somefile.module.css) although i able to generate the css file and consuming it in host application . but im getting below error

Error
Below is my plugin code

State.jsx

import React , { useState } from "react";
import classes from './State.module.css';

export const  State = () => {
     // Declare a new state variable, which we'll call "count"
  const [count, setCount] = useState(0);

  return (
    <div className={classes.background-div}>
      <p>You clicked {count} times</p>
      <button onClick={() => setCount(count + 1)}>
        Click me
      </button>
    </div>
  );
}

State.module.css

p{
    background-color: red;
}

.backgroundDiv{
    background-color: blue;
    color: white;

}

rollup.config.js

import resolve from 'rollup-plugin-node-resolve';
import babel from 'rollup-plugin-babel';
import commonjs from 'rollup-plugin-commonjs';
import generatePackageJson from 'rollup-plugin-generate-package-json'

import postcss from 'rollup-plugin-postcss';

export default {
    input: 'src/index.jsx',
    output: {
        file: 'dist/bundles/bundle.js',
        format: 'cjs'
    },
    external: [
        'react',
        'react-dom'
    ],
    plugins: [
        resolve({ extensions: ['.jsx', '.js', '.tsx'] }),
        commonjs(),
        babel({
            extensions: ['.jsx', '.js', '.tsx'], 
            exclude: 'node_modules/**'
        }),
        postcss(
            {
                modules:true,
                extract: true,
            }
        ),
        generatePackageJson({
            outputFolder: 'dist',
            baseContents: (pkg) => ({
                name: pkg.name,
                main: 'bundles/bundle.js',
                peerDependencies: {
                  "react": "^18.2.0"
                }
            })            
        })
    ]
};

So how can i resolve this issue or is my post css is correct ?