nieldlr / hanzi

HanziJS is a Chinese character and NLP module for Chinese language processing for Node.js
http://hanzijs.com
MIT License
375 stars 56 forks source link

When running 'npm run build': Failed to minify '../cedict_ts.u8.js' #45

Open ghost opened 6 years ago

ghost commented 6 years ago

Hello again.

I was trying to use Hanzi with React where, to deploy, you must first run the command npm run build.

I got the following error when doing so:

Failed to minify the code from this file: ./node_modules/hanzi/lib/data/cedict_ts.u8.js:1

Upon research, I found this issue where it is said that

You may occasionally find a package you depend on needs compiled or ships code for a non-browser environment. This is considered poor practice in the ecosystem and does not have an escape hatch in Create React App.

So, with my very limited knowledge, I'm guessing there's no easy fix here? And it actually requires a lot of work to make these changes?

Just posting in case I'm wrong. But if I'm not. That's okay too.

Thank you Niel for being so patient with me.

nieldlr commented 6 years ago

Heya @Dans-io,

interesting. Is this for React-Native? I haven't quite encountered this myself yet. Sorry for all the trouble here.

ghost commented 6 years ago

Negative. This is plain React where, before deploying, you normally wanna run the command npm run build which serves to minify all code. That's when I get this error.

Perhaps @zurawiki can help us yet again?

In any case, this isn't urgent. Thanks for the reply and help Niel & Roger.