chanind / hanzi-writer

Chinese character stroke order animations and practice quizzes
https://hanziwriter.org
MIT License
3.44k stars 534 forks source link

webpack issues #284

Closed linguamao closed 1 year ago

linguamao commented 1 year ago

Hi,webpack 5.75. I got error when building the package.

./node_modules/hanzi-writer-data/APL/big5/ARPHICPL.TXT:1:0 - Error: Module parse failed: Unexpected character '�' (1:0) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

�幩�������v�� | | �ۧ@�v�Ҧ�(C) 1999 �幩��޶}�o�ѥ��������q

./node_modules/hanzi-writer-data/APL/english/ARPHICPL.TXT:1:7 - Error: Module parse failed: Unexpected token (1:7) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

ARPHIC PUBLIC LICENSE | | Copyright (C) 1999 Arphic Technology Co., Ltd.

./node_modules/hanzi-writer-data/APL/gb/ARPHICPL.TXT:1:0 - Error: Module parse failed: Unexpected character '�' (1:0) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

�Ķ�������Ȩ�� | | ��Ȩ����(C) 1999 �Ķ��Ƽ������ɷ����޹�˾

Any help would be much appreciated.

chanind commented 1 year ago

What's your setup with webpack? It looks like it's trying to load the Arphic license TXT file via webpack somehow? That seems incorrect - you should just need to load the individual character JSON files if you want to load the data directly inside of webpack. Are you trying to import the Arphic license TXT file in your code somehow?

linguamao commented 1 year ago

@chanind Many thanks David. Indeed that's the case. I dropped the data outside of node_modules and load the json files with the correct path and it worked. Thanks again for the wonderful work!