guocaoyi / create-chrome-ext

🍺 Scaffolding your Chrome extension! Boilerplates: react \ vue \ svelte \ solid \ preact \ alpine \ lit \ stencil \ inferno \ vanilla
MIT License
1.42k stars 106 forks source link

Uncaught TypeError: Cannot read properties of undefined (reading 'sync') #81

Closed ChrisGrigg closed 2 months ago

ChrisGrigg commented 2 months ago

Forgive my ignorance if I'm barking up the wrong tree I'm brand new to chrome extension development. When I try npm run dev then visit http://localhost:5173/sidepanel.html

I get the error;

react-dom_client.js?v=b833d8d0:16657 Uncaught TypeError: Cannot read properties of undefined (reading 'sync') at SidePanel.tsx:10:20

In other words the chrome.storage property is undefined. Is there any way around this or does it need to be in a chrome extension environment i.e. load unpacked into the chrome://extensions/?