You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a workspace with shared code. This lists react-minisearch as a peerDependency. I my other workspace that needs this shared code I've got a dependency with react-minisearch. I also see react-minisearch in the node_modules dir of this workspace. Though when I try to load this web project in a browser I see
Uncaught SyntaxError: The requested module '/@id/__vite-optional-peer-dep:react-minisearch:@snoriman/shared' does not provide an export named 'useMiniSearch' (at DataTable.jsx:32:10)
When I include this dependency in my vite.config.js into the optimizeDeps field like below, it works fine. Is this expected or am I doing something wrong? I would expect Vite to pickup the packages that are installed in the local node_modules directory.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I have a workspace with shared code. This lists react-minisearch as a peerDependency. I my other workspace that needs this shared code I've got a dependency with react-minisearch. I also see react-minisearch in the node_modules dir of this workspace. Though when I try to load this web project in a browser I see
When I include this dependency in my vite.config.js into the
optimizeDeps
field like below, it works fine. Is this expected or am I doing something wrong? I would expect Vite to pickup the packages that are installed in the local node_modules directory.Beta Was this translation helpful? Give feedback.
All reactions