PrismarineJS / node-minecraft-data

Provide easy access to minecraft-data in node.js
https://prismarinejs.github.io/minecraft-data/
100 stars 55 forks source link

minecraft-data makes programs (Sveltekit) crash #349

Closed lolouthefox closed 5 months ago

lolouthefox commented 5 months ago

I have an issue where using node-minecraft-data makes my code crash, there's is probably too much data to load. Is there any way to fix it, or is it a problem with the package?

extremeheat commented 5 months ago

You need to elaborate on what the actual problem is beyond "it crashes". As this is an issue on your side I can't say what the problem is but from what it sounds if your bundle is too big then you may need to add logic to only include files that are relevant to your project in the bundle.

If you are using webpack you can take a look at https://webpack.js.org/plugins/ignore-plugin/

lolouthefox commented 5 months ago

I said, I'm using Sveltekit and there is literally no way to control that. The package is just importing everything when it loads and it crashes the Node server and the client (web browser).

rom1504 commented 5 months ago

use a framework that provides better features than "literally no way to control that" then.

rom1504 commented 5 months ago

or you can give us some information on what you are doing; your call

lolouthefox commented 5 months ago

I said! I'm just importing the lib, nothing else. I literally use import whatever from 'node-minecraft-data'; on client ("+page.svelte") in a script tag.

lolouthefox commented 5 months ago

The package/lib is not optimized, that's it. Y'all should use functions to import data dynamically instead of reading all files and storing everything in RAM

lolouthefox commented 4 months ago

At least just assign the issue to me so I work on it some time later and make the lib load correctly @rom1504