lukePeavey / SplitType

Javascript utility that splits text into lines, words, characters for animation
https://lukepeavey.github.io/SplitType/
566 stars 40 forks source link

Typescript error on building NextJS 14 app #71

Open MarkMichos opened 9 months ago

MarkMichos commented 9 months ago

Hi,

I have a strange behaviour that just happened after purging my package-lock.json, node_modules folder and .next folder and gave my app a fresh npm install.

Suddenly there is an error with SplitType that was not there before.

image

The line types: 'words, chars', is stating the error Type '"words, chars"' is not assignable to type 'TypesList | undefined'. Did you mean '"words,chars"'?

Now, when I remove the space -> types: 'words,chars' the error seems to be gone in VS Code, but as you can see in the screen that when I run npm run build the typescript error is showing up WITH a space.

I already updated and restarted VS Code, I again purged node_modules, package-lock and .next but this error keeps persisting.

So where does the space between 'words, chars' coming from, when it is not in my code any more and why is this even considered as an error in the first place when it worked all the time and even in the SplitTypes docs it is written with a space?

steveninety commented 8 months ago

You'll need to disable stylistic formatting in your linter (eslint probably) for that particular line