Comments (11)
Will be reworking the imports in an upcoming PR which might fix this, or help us narrow down the issue.
from kbar.
Hey @WhoAdarshPandya, apologies for the late response! Can you try the latest release and let me know what you see there?
from kbar.
im seeing this error too with a vite build ...looks like the trace is pointing to:
var _c = (0, useKBar_1.default)(function (state) { return ({
visualState: state.visualState,
showing: state.visualState !== types_1.VisualState.hidden,
}); }), query = _c.query, options = _c.options, visualState = _c.visualState, showing = _c.showing;
useToggleHandler
in InternalEvents.js
; am getting useKBar_1.default is not a function
. unsure why though
from kbar.
This should be resolved in the latest release – thank you @kevinhu!
from kbar.
hey tim! Awsome work with the Kbar, i've been using it in my preact app - in dev mode it works fine but after production build it doesn't work. consider me a noob trying to solve things.
it shows something like this in console
vendor.822cbe4a.js:29 Uncaught TypeError: (0 , Zt.default) is not a function at Gf (vendor.822cbe4a.js:29) at Y.qf [as constructor] (vendor.822cbe4a.js:29) at Y.Ho [as render] (vendor.822cbe4a.js:1) at dr (vendor.822cbe4a.js:1) at ti (vendor.822cbe4a.js:1) at dr (vendor.822cbe4a.js:1) at ti (vendor.822cbe4a.js:1) at dr (vendor.822cbe4a.js:1) at ti (vendor.822cbe4a.js:1) at dr (vendor.822cbe4a.js:1) Gf @ vendor.822cbe4a.js:29 qf @ vendor.822cbe4a.js:29 Ho @ vendor.822cbe4a.js:1 dr @ vendor.822cbe4a.js:1 ti @ vendor.822cbe4a.js:1 dr @ vendor.822cbe4a.js:1 ti @ vendor.822cbe4a.js:1 dr @ vendor.822cbe4a.js:1 ti @ vendor.822cbe4a.js:1 dr @ vendor.822cbe4a.js:1 Ie @ vendor.822cbe4a.js:1 (anonymous) @ index.dc5496f6.js:formatted:113
in index.js (pretty-printed) it highlights this portion
y(i(r.KBarProvider, { actions: S, children: [o(r.KBarPortal, { children: o(r.KBarPositioner, { children: i(r.KBarAnimator, { style: B, children: [o(r.KBarSearch, { style: k, placeholder: "Type a command or search\u2026" }), o(r.KBarResults, {})] }) }) }), o(g, { children: o(v, {}) })] }), document.getElementById("app"));
it'd be really great if you can help me with this. thanks in advance
update: it does work with webpack config, I think the problem is with usage of vite, can you please suggest something?
from kbar.
hey @timc1 , Thanks for reply, i guess problem comes when we try to bundle it with vite! webpack works fine with Kbar
from kbar.
hey @timc1 , Thanks for reply, i guess problem comes when we try to bundle it with vite! webpack works fine with Kbar
@WhoAdarshPandya How you fixed this issue finally? Replacing vite with webpack?
from kbar.
hey @timc1 , Thanks for reply, i guess problem comes when we try to bundle it with vite! webpack works fine with Kbar
@WhoAdarshPandya How you fixed this issue finally? Replacing vite with webpack?
not yet fixed, even I can't find what causes error because it works perfect in dev mode. can't replace vite for webpack which is laggy and slow compared to vite
from kbar.
thanks — I can test the branch on my build when it’s posted!
from kbar.
I had this issue as well, and it seems that Vite is unhappy about the default export syntax applied to a function. If you switch it to a named export, the build error goes away: #131
from kbar.
from kbar.
Related Issues (20)
- Key shortcuts not suppressed in elements with `plaintext-only` contenteditable HOT 1
- react 18 unmet peer dependencies HOT 5
- unable to input Chinese correctly HOT 8
- Dependency error with `react-virtual` HOT 12
- Any way to find out if the menu is open?
- No style HOT 3
- [question] Is it possible trigger useKBar hooks using AstroJS? HOT 1
- Search doesn't match last word when entry is coming from `useRegisterActions` HOT 6
- Feature: Adding Action options to prevent keyboard events from firing unintentionally HOT 1
- Performance bug: Keystrokes lost when typing fast in slow environments HOT 2
- Search doesn't clear when changing currentRootActionId in the latest version HOT 3
- Bug: Backspace keyboard event being received by pages HOT 2
- More control over the returned matches HOT 1
- useMatches rootActionId and results are out of sync HOT 1
- [Feature] Add property to optionally enable shortcuts on form fields HOT 1
- Documentation for parent elements and sub-search HOT 1
- Callback on perform, without replacing perform HOT 1
- button HOT 1
- Next.js 14 App router layout.tsx: Fails to spawn the command palette HOT 2
- Actions with parent proporty get added twice.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kbar.