Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Uncaught Error: Cannot find module '@plasmohq/storage' #1123

Open
2 of 3 tasks
HansBhatia opened this issue Oct 24, 2024 · 3 comments
Open
2 of 3 tasks

[BUG] Uncaught Error: Cannot find module '@plasmohq/storage' #1123

HansBhatia opened this issue Oct 24, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@HansBhatia
Copy link

What happened?

I'm using google chrome.

The load unpacked extension works when built with plasmo dev, however if I use plasmo build the extension does not do anything and checking the extension error logs I get the error 'Uncaught Error: Cannot find module '@plasmohq/storage''

versions
"@plasmohq/storage": "^1.12.0",
"plasmo": "0.89.3"

file structure:
Screenshot 2024-10-24 at 13 48 54

storage.ts
`import { Storage } from "@plasmohq/storage"

export const storage = new Storage()`

content.ts:
`export var connectionList: ConnectionList = {}
window.addEventListener("load", () => {
console.log("LinkedIn connection categorizer extension loaded.")
// set timeout to wait for the page to load
setTimeout(async () => {
connectionList = (await storage.get("connectionList")) ?? {}
injectCategorize()
addMutationObserver()
}, 1000)
})

window.addEventListener("beforeunload", () => {
storage.set("connectionList", connectionList)
})`

Version

Latest

What OS are you seeing the problem on?

MacOSX

What browsers are you seeing the problem on?

Chrome

Relevant log output

Uncaught Error: Cannot find module '@plasmohq/storage'

(OPTIONAL) Contribution

  • I would like to fix this BUG via a PR

Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I checked the current issues for duplicate problems.
@HansBhatia HansBhatia added the bug Something isn't working label Oct 24, 2024
@HansBhatia
Copy link
Author

I had this in my package.json and it broke everything:
"engines": {
"npm": ">=7.0.0",
"node": ">=16.0.0"
},

@HansBhatia
Copy link
Author

Now I'm just curious why...

@zuosihui
Copy link

你这编辑器主题好看,是什么主题,推荐一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants