Closed rohan-logicrays closed 5 months ago
"@yaireo/tagify": "^4.21.1",
import Tags from "@yaireo/tagify/dist/react.tagify";
using it like this only dont know why getting this error
chunk-RYOGGBNK.js?v=fbc70bda:19441 Uncaught SyntaxError: The requested module '/node_modules/prop-types/index.js?v=fbc70bda' does not provide an export named 'array' (at react.tagify.jsx:13:18)
do you have any error if you are importing like so?
import Tags from "@yaireo/tagify/react"
Failed to resolve import "@yaireo/tagify/react" from "src/utils/Input/SelectTag/SelectTagComponent.tsx". Does the file exist?
i am getting this error when i try your way
Are you absolutely sure you have the latest version of Tagify?
because my official Codesandbox demo here shows it works:
Also I have a repo showing this works:
https://github.com/yairEO/tagify-react-test/blob/master/src/App.jsx#L2
I move back to the older version "@yaireo/tagify": "^4.21.1", "@types/yaireo__tagify": "^4.18.0",
now the error is different chunk-RYOGGBNK.js?v=80573a65:9145 Uncaught DOMException: Failed to execute 'toggle' on 'DOMTokenList': The token provided ('form-control custom-class d-flex gap-2 ps-1 tag-placeholder ') contains HTML space characters
this error does not seem to be related to Tagify. Also, I do not recommend downgrading as I constantly fix bugs and have very recently, in the past week, have fixed a few important ones.
Which bundler are you using and its version & your Node version?
I also have the smae issue. I am using Vite as bundler. and use node 21 The issue seems to be realted with VIte as the problem doesnt occur while i use storybook
I am using Vite in my test project also, to test Tagify, and have no problems:
yairEO/tagify-react-test@master/src/App.jsx#L2
With the minimal config
I seem to be having the same issue.
If I run your test project yairEO/tagify-react-test@master/src/App.jsx#L2 but install Tagify via npm rather than as a local dependency as you have it, I can recreate the issue.
Thanks for your help btw.
@lweibel - are you using the latest Tagify version?
How are you importing it? it matters if you are importing directly from the src
folder or the dist
folder
Here are the steps I took to create the error:
mkdir test
cd test
git clone https://github.com/yairEO/tagify
cd tagify
npm i
cd ..
git clone https://github.com/yairEO/tagify-react-test
cd tagify-react-test
npm remove @yaireo/tagify
npm i @yaireo/tagify
npm run dev
This installed 4.27.0.
I tried importing it in all the ways you have mentioned here and in the documentation. Do you also get an error?
@lweibel - have you tried what I've suggested here? https://github.com/yairEO/tagify#react
A none-minified and raw source-code Tagify React component is exported from react.tagify.jsx and you can import it as seen in the below code example. This React port will only work if your bundler can handle raw source-code in ES2015+ which is better for tree-shaking.
If you get bundling errors, import Tagify (react port) from the
dist
folder:@yaireo/tagify/dist/react.tagify
Yes, you can try running it. I am using your repository.
@lweibel - are you using npm
or pnpm
? it matters
Here are the steps I took to create the error:
mkdir test cd test git clone https://github.com/yairEO/tagify cd tagify npm i cd .. git clone https://github.com/yairEO/tagify-react-test cd tagify-react-test npm remove @yaireo/tagify npm i @yaireo/tagify npm run dev
This installed 4.27.0.
I tried importing it in all the ways you have mentioned here and in the documentation. Do you also get an error?
npm
chunk-RYOGGBNK.js?v=73822179:19441 Uncaught SyntaxError: The requested module '/node_modules/prop-types/index.js?v=73822179' does not provide an export named 'array' (at react.tagify.jsx:13:18)