NextChat icon indicating copy to clipboard operation
NextChat copied to clipboard

[Bug] 无法导入本地的json数据

Open hugo0819 opened this issue 1 year ago • 1 comments

Bug Description

我原来使用的是2.9.13版本,下载最新的2.12.3版本后,原来导出的本地数据无法导入,导入时直接显示导入失败,请问应该怎么解决?

Steps to Reproduce

在2.9.13版本的设置中选择导出本地数据 在2.12.3版本的设置中选择导入本地数据

Expected Behavior

正常导入所有的聊天数据

Screenshots

No response

Deployment Method

  • [ ] Docker
  • [ ] Vercel
  • [ ] Server

Desktop OS

Windows 10

Desktop Browser

No response

Desktop Browser Version

No response

Smartphone Device

No response

Smartphone OS

No response

Smartphone Browser

No response

Smartphone Browser Version

No response

Additional Logs

No response

hugo0819 avatar May 21 '24 10:05 hugo0819

Bot detected the issue body's language is not English, translate it automatically.


Title: [Bug] Unable to import local json data

Issues-translate-bot avatar May 21 '24 10:05 Issues-translate-bot

do you have any screenshot about error log in browser devtool, I need know the detail about the error

Dean-YZG avatar May 27 '24 07:05 Dean-YZG

It only shows import failure and there is no extra display

hugo0819 avatar May 27 '24 07:05 hugo0819

这是因为v2.11.2及以前的版本源码在导出时是使用的二进制格式导出,所以导入时解析失败了。 我的解决方法是本地拉取对应历史版本的代码,然后把utils.ts#L59这块的代码换成最新版本的代码,然后再使用visual studio重新打包出来一个应用程序文件,运行后用新的代码导出文件,就可以正常进行导入了。 或者降级成v2.9.7版本试试,这个版本源码正常,导出的文件应该也是可以正常导入的

ArlenWay73 avatar May 30 '24 06:05 ArlenWay73

Bot detected the issue body's language is not English, translate it automatically.


This is because v2.11.2 and previous version source code uses the binary format when exporting Exported, so parsing failed during import. My solution is to locally pull the code corresponding to the historical version, then replace the code in utils.ts#L59 with the latest version, and then use visual studio to repackage an application file, and use the new one after running it. The code export file can be imported normally.

Issues-translate-bot avatar May 30 '24 06:05 Issues-translate-bot