I had to create a new tab to get this to

I had to create a new tab to get this to work.
21 Replies
Adeel Ehsan
Adeel Ehsan•2y ago
can you explain what do you mean had to create new tab ?
Brandon
BrandonOP•2y ago
I just mean after I reloaded the extension, I had to use a new tab. All existing tabs wouldn't work.
Adeel Ehsan
Adeel Ehsan•2y ago
Okay. Do i have to create the content folder and then create the file inside it? Or the content.txt is fine ?
Brandon
BrandonOP•2y ago
I have contents/content.tsx
Adeel Ehsan
Adeel Ehsan•2y ago
let me try that. new tab is't working for me
Adeel Ehsan
Adeel Ehsan•2y ago
still no luck
Brandon
BrandonOP•2y ago
Can you share the files you have?
Adeel Ehsan
Adeel Ehsan•2y ago
would that work? or I should share all the files in zip folder ?
Brandon
BrandonOP•2y ago
change const res = await sendToContentScript({ name: "getContent" }) to const res = await sendToContentScript({ name: "content" })
Arcane
Arcane•2y ago
@Brandon has reached level 2. GG!
Brandon
BrandonOP•2y ago
in popup.tsx
Adeel Ehsan
Adeel Ehsan•2y ago
still no luck same error
Brandon
BrandonOP•2y ago
I copied and pasted yours and it's working for me* with my suggested change Someone suggested closing the browser and restarting it
Adeel Ehsan
Adeel Ehsan•2y ago
Hmmm. strange tried that as well
Arcane
Arcane•2y ago
@Adeel Ehsan has reached level 2. GG!
Adeel Ehsan
Adeel Ehsan•2y ago
Do you have other tabs open? can you please share package.json?
Brandon
BrandonOP•2y ago
json {
"name": "Chrome Extension",
"displayName": "Web Chrome Extension",
"version": "0.0.1",
"description": "Here's the description of the app",
"author": "Me",
"scripts": {
"dev": "plasmo dev",
"build": "plasmo build",
"test": "plasmo test"
},
"dependencies": {
"@plasmohq/messaging": "^0.6.1",
"plasmo": "0.84.0",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@ianvs/prettier-plugin-sort-imports": "4.1.1",
"@types/chrome": "0.0.251",
"@types/jquery": "^3.5.29",
"@types/node": "20.9.0",
"@types/react": "18.2.37",
"@types/react-dom": "18.2.15",
"prettier": "3.0.3",
"typescript": "5.2.2"
},
"manifest": {
"host_permissions": [
"https://*/*"
]
}
}
json {
"name": "Chrome Extension",
"displayName": "Web Chrome Extension",
"version": "0.0.1",
"description": "Here's the description of the app",
"author": "Me",
"scripts": {
"dev": "plasmo dev",
"build": "plasmo build",
"test": "plasmo test"
},
"dependencies": {
"@plasmohq/messaging": "^0.6.1",
"plasmo": "0.84.0",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@ianvs/prettier-plugin-sort-imports": "4.1.1",
"@types/chrome": "0.0.251",
"@types/jquery": "^3.5.29",
"@types/node": "20.9.0",
"@types/react": "18.2.37",
"@types/react-dom": "18.2.15",
"prettier": "3.0.3",
"typescript": "5.2.2"
},
"manifest": {
"host_permissions": [
"https://*/*"
]
}
}
I didn't make any changes to my package.json yeah I have a whole bunch of tabs open, but every time I reload the extension, I open a new tab
Adeel Ehsan
Adeel Ehsan•2y ago
I have closed all the tabs and restart the browser and then opened only single tab only are you using npm or pnpm ? I am using npm can you please share the zip folder of your project ? if possible
Brandon
BrandonOP•2y ago
I'm using pnpm pnpm dev @Adeel Ehsan Not sure if you figured it out, but I just ran into it again. I deleted the build folder and built it again. Then it worked. Something else to try

Did you find this page helpful?