🧩 Plasmo Developers

PD

🧩 Plasmo Developers

Join the community to ask questions about 🧩 Plasmo Developers and get answers from other members.

Join

👾extension

👟framework

🔰newbie

🦉pallas

Simply adding a file to the root of the chrome-mv3 folder for dev and production when running plasmo

I need to add a schema.json file to the root (for development and production once distributed). Is there a straightforward way to achieve bundling the file and having it located in the root of the bundle? - it must be in the root - see above; so NOT in the assets folder...
Solution:
It's as easy as adding the file to the root and then including it in package.json's manifest 😰 `"web_accessible_resources": [ { "resources": [...

PostHog identification

I’m working on a Next.js 14 project, where I’m using an API to retrieve user details (with the logic inside background/ports/file.ts). The login redirects users to our product’s URL, and we’re checking authentication via JWT. Where would be the best place to call posthog.identify()?

Toast

How can I dynamically inject PrimeReact Toast with its full styles into the currently opened webpage from a Chrome extension's popup? I want the Toast to remain hidden until a message is received from the popup, and I also want to make sure the animation works properly. Currently, the Toast appears without animation, and it only shows once. After the first display, it doesn't show again, even though there are no errors in the console logs. Are there any simpler UI libraries that can be used for...

error framework

#plasmo Hello, i am getting this error. When i trying to unitialize shadcn using pnpm dlx shadcn@latest init...
No description

Error in autogenerated prod index.js file

I am getting an error in the build -> chrome-mv3-prod -> static/background -> index.js file. I am guessing there is supposed to be quotes around the URL (see screenshots). Since this is auto-generated, when I run pnpm build, my changes get overridden. I am running Plasmo v0.89.2....
No description

Plasmo with react and MUI

After following the steps mentioned in the docs or example, mui is not working. It is throwing error defaultShouldForwardProp is not a function. Seems something to do with material ui itself. Anybody know any workaround for this?

Sending messages to a content script in the "main" world

What's the current best practice for sending messages from a background script/popup/sidebar to a content script running in the "main" world? So far I've succeeded only by using another content script (bridge) to intercept messages via listen() and then relay them to the other content script using window.postMessage(). For the opposite direction the "main" world script uses sendToBackgroundViaRelay() and the bridge uses relayMessage() to forward it to the background. Perhaps something like sendT...

Possibility to customize path aliases?

I want to have all my extension related pages in one directory (e.g. /app). Is it possible? I tried the solution below, but it's not working: tsconfig.json...

Publishing to Multiple Markets using @PlasmoHQ/bpp github action

Hello everyone! Hope you're doing well! I'm having a bit of trouble on how to publish my extension to multiple markets. I currently only publish it to Chrome Webstore, but want to enable it for Firefox and eventually Edge. I use the @PlasmoHQ/bpp, which states:...

Build Failure | (reading 'message') | AssistantUI | React

I'm using assistant UI in my React Plasmo application, resulting into following error.
No description

Turborepo with Svelte and shadcn-svelte as a package

Hi! I'm trying to set up a monorepo using Turborepo with Plasmo using Svelte and shadcn-svelte as a package. However, when I tried importing a component that's exported by the ui package, I'm getting the following error. Does anyone know how to fix this?...
No description

Remove "getInlineAnchor" zIndex style

Is it possible to remove the style z-index: 2147483647; from the plasmo-shadow-container div? Currently, my content is stick to the page, I don't want it to have z-index style. Thanks in advance....

Cannot resolve bits-ui when using Svelte with shadcn-svelte

I'm using Svelte and have been trying to use it with shadcn-svelte. Some of the components work fine, but when I tried to use the ScrollArea which uses bits-ui, I'm getting the following error: Failed to resolve 'bits-ui' from './src/components/ui/scroll-area/scroll-area-scrollbar.svelte' Has anyone encountered this before or knows how to solve this? Thanks!...

useState is not working

https://discord.com/channels/946290204443025438/1282889494596550717 I have posted a question regarding useState not functioning properly. Has any of you faced the same problem before?...

how to use Svelte reactivity on CS?

Maybe I'm too dumb, but what's wrong? Wasn't that supported? ```js <script context="module" lang="ts"> import cssText from "data-text:~/style.css"; import type { PlasmoCSConfig, PlasmoGetInlineAnchor, PlasmoMountShadowHost } from "plasmo";...

CLI: `plasmo dev` is freezing & unresponsive

Hey @lab 👋, Just opened this GH issue: https://github.com/PlasmoHQ/plasmo/issues/1062 Any idea how I can get more verbose logs to debug my issue?...

Anyone facing issue while installing shadcn?

I get an error that says "couldn't find the framework" when I try to initialize shadcn and create components.json file?

getInlineAnchor being invoked repeatedly, even after CSUI is rendered

is it normal for getInlineAnchor to be invoked repeatedly by the Plasmo framework, even after the anchor is found to exist and the CSUI renders? I have a very basic extension, where I just want to add a button next to the <body> element of the page. I have the following snippet ``` export const getInlineAnchor: PlasmoGetInlineAnchor = async () => {...

Environment vars with manifest override arrays

I have an array of urls in the host permission section of my manifest override in my package.json: ``` "host_permissions": [ "http://localhost/*",...

HMR becoming less and less reliable as project size grows

Originally the HMR worked very well however as my project has grown in size (over 100 files) it has become less reliable. According to the dev server it is repackaging the extension when I save. However when I then reload the page for the content script those changes are not there. Instead I have to restart the dev server to see the new changes.