sindresorhus / electron-store

Simple data persistence for your Electron app or module - Save and load user preferences, app state, cache, etc
MIT License
4.61k stars 150 forks source link

Calling `new Store` throws Dynamic require error #226

Closed Seanmclem closed 2 years ago

Seanmclem commented 2 years ago

When I

import Store from 'electron-store';

And add the line

const store = new Store();

I get the error

Dynamic require of "path" is not supported

And my app does not work.

"electron-store": "^8.0.1", "electron": "^17.1.2",

sindresorhus commented 2 years ago

This is sounds like a problem with your build tool or its config.

Seanmclem commented 2 years ago

This is sounds like a problem with your build tool or its config.

probably, it happened with another storage lib too. Any tips? The consensus from Google of "probably Vite" hasn't really helped much so far