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

Cannot read properties of undefined (reading 'split') #1434

Open
buteanrares opened this issue Jan 21, 2025 · 1 comment
Open

Cannot read properties of undefined (reading 'split') #1434

buteanrares opened this issue Jan 21, 2025 · 1 comment

Comments

@buteanrares
Copy link

buteanrares commented Jan 21, 2025

I have a Vite React app, with the latest Tagify version.

The below code:

import Tagify from '@yaireo/tagify';
import '@yaireo/tagify/dist/tagify.css';

export default function Page(){
....

return <Tags
                  value={[
                    { value: '1', label: 'Recipient One' },
                    { value: '2', label: 'Recipient Two' },
                  ]}
                  settings={{
                    delimiters: ',',
                    pattern: /^[^\s@]+@[^\s@]+\.[^\s@]+$/,
                    dropdown: {
                      enabled: 0,
                    },
                  }}
                  onChange={(e) => {
                    const selectedTags = e.detail?.tagify?.value || [];
                    console.log(selectedTags);
                  }}
                />
}

produces this error:

chunk-KDCVS43I.js?v=bd7b0da0:16718 Uncaught TypeError: Cannot read properties of undefined (reading 'split')
    at compareStrings (react.tagify.jsx?t=1737447606098:27:23)
    at react.tagify.jsx?t=1737447606098:183:34
    at commitHookEffectListMount (chunk-KDCVS43I.js?v=bd7b0da0:16963:34)
    at invokePassiveEffectMountInDEV (chunk-KDCVS43I.js?v=bd7b0da0:18374:19)
    at invokeEffectsInDev (chunk-KDCVS43I.js?v=bd7b0da0:19754:19)
    at commitDoubleInvokeEffectsInDEV (chunk-KDCVS43I.js?v=bd7b0da0:19739:15)
    at flushPassiveEffectsImpl (chunk-KDCVS43I.js?v=bd7b0da0:19556:13)
    at flushPassiveEffects (chunk-KDCVS43I.js?v=bd7b0da0:19500:22)
    at commitRootImpl (chunk-KDCVS43I.js?v=bd7b0da0:19469:13)
    at commitRoot (chunk-KDCVS43I.js?v=bd7b0da0:19330:13)

hook.js:608 The above error occurred in the <TagifyWrapper> component

Didn't find a solution for this, and never encountered it before.
The react demo doenst really help because it has an error.

@buteanrares buteanrares changed the title Cannot set properties of undefined (setting 'isFirefox') Cannot read properties of undefined (reading 'split') Jan 21, 2025
@yairEO
Copy link
Owner

yairEO commented Jan 22, 2025

Can you please create a very simple JSBIN demo which shows this?

clone & edit the below:
https://jsbin.com/jekuqap/edit?html,js,output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants