Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"TypeError: N is not a function" when trying to open transform modal #301

Closed
LoganGrasby opened this issue Aug 16, 2023 · 8 comments
Closed
Labels
bug Something isn't working

Comments

@LoganGrasby
Copy link

This error is reproducible in the demo as well at https://jsbin.com/gatibux/edit?html,output

I have been using the vanilla js version through the CDN and noticed this issue beginning 2-3 days ago. I've also noticed that larger files now cause the page to crash, but it's unclear if that is related to this error. Previously the same files could be imported without issue. I noticed both issues around the same time and I have only used the editor through the CDN (same CDN url as the demo above).

Also, this is an amazing project thank you for sharing your work!

@josdejong
Copy link
Owner

Ouch! That is an ugly regression, introduced in v0.17.9, two days ago. Fixed now in v0.17.10.

Thanks for your kind words, glad you like the editor 😄.

@josdejong josdejong added the bug Something isn't working label Aug 16, 2023
@LoganGrasby
Copy link
Author

Thanks! Seems to be working now. I'm still experiencing the issue with the page crashing with large files so it seems to be unrelated. It's a bit difficult to diagnose as my browser crashes immediately after trying to load the editor with a file larger than ~10mb. I was definitely able to load the file in question a few days ago. I'm importing from 'https://unpkg.com/vanilla-jsoneditor/index.js'. Any idea what the issue might be?

@josdejong
Copy link
Owner

Hm, I've tested with some files ranging from 20MB to 415MB and these still work smooth. How can I reproduce the issue you're encountering with this ~10MB file?

@josdejong josdejong reopened this Aug 16, 2023
@LoganGrasby
Copy link
Author

LoganGrasby commented Aug 18, 2023

Hmm I've been testing this for some time and I haven't been able to figure out what the issue is. All I can tell right now is that the main thread appears to be getting blocked with larger file sizes until eventually the page crashes. At just under 10mb the page will become unusable for a moment but eventually unblock once the table renders. I'm loading the file in table mode if that makes a difference? I have text set to undefined. I prepare files in advance with papaparse. I was wondering if I might have introduced a conflict somehow there. I wish I could be more helpful. Feel free to close if there's nothing obvious I should try as it might be an issue on my end.

@josdejong
Copy link
Owner

Is it possible to share the JSON file that gives troubles? If not public, you can email it to me privately? If the latest version of the editor has a regression in the performance I would love to know.

@josdejong
Copy link
Owner

josdejong commented Aug 18, 2023

And on a side note: I recently wrote a CSV parser myself because I couldn't use papaparse or other popular CSV libaries, it may be interesting to you, see https://github.com/josdejong/csv42.

@LoganGrasby
Copy link
Author

Thanks! I'll send you an email with the file.

@josdejong
Copy link
Owner

For others: the issue with table mode being slow was caused by the editor not having a fixed height. That forces the editor to render all rows (which is slow for large documents). When the editor has a fixed height, it will only render the visible rows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants