Pupix/lol-wad-parser

ReferenceError: primordials is not defined? Is there any change now?

abearxiong opened this issue · 5 comments

ReferenceError: primordials is not defined
at fs.js:27:26
at req_ (F:\git\github download\lol-wad-parser-master\lol-t\node_modules\natives\index.js:143:24)
at Object.req [as require] (F:\git\github download\lol-wad-parser-master\lol-t\node_modules\natives\index.js:55:10)
at Object. (F:\git\github download\lol-wad-parser-master\lol-t\node_modules\xp-fs\node_modules\graceful-fs\fs.js:1:37)
at Module._compile (internal/modules/cjs/loader.js:759:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
at Module.load (internal/modules/cjs/loader.js:628:32)
at Function.Module._load (internal/modules/cjs/loader.js:555:12)
at Module.require (internal/modules/cjs/loader.js:666:19)
at require (internal/modules/cjs/helpers.js:16:16)

Pupix commented

Need more info on this. The stack you showed doesn't help because it has no direct link to the library. It fails somewhere in node_modules/natives.

What is lol-t?
How are you using this?
Can you post the code you are using?

image

image

index.js

var WadParser = require('lol-wad-parser'),
	wad = new WadParser();
	wad.rade('default-assets.wad',function(err, data){
		console.log(data);
	});

thank you!

but i don’t need it now.because i‘m use RavioliGameTools_v2.10 to get some file from *.wad

Unfortunately, I can't understand the contents of the data at the end. This exploration process is over

Snipaste_2019-08-26_16-25-54

This is the file I got.

I don't know if there is a problem, but my previous steps are like this.

  1. mkdir lol
  2. cd lol
  3. npm init
  4. npm install lol-wad-parser
+ lol-wad-parser@0.14.0
added 196 packages from 188 contributors and audited 323 packages in 596.499s
found 12 vulnerabilities (4 low, 8 high)
  run `npm audit fix` to fix them, or `npm audit` for details
  1. copy code to index.js
var WadParser = require('lol-wad-parser'),
    wad = new WadParser();

    wad.read('assets.wad', function (err, data) {
        console.log(data);
    });
  1. copy assets.wad to this folder....\Plugins\rcp-fe-lol-tft assets.wad.its description.json.
{
    "name": "rcp-fe-lol-tft",
    "version": "0.0.1",
    "pluginDependencies": {
        "rcp-fe-ember-libs": "0.0.22",
        "rcp-fe-common-libs": "1.0.0",
        "rcp-fe-viewport": "0.0.18",
        "rcp-fe-lol-l10n": "0.0.18",
        "rcp-fe-lol-uikit": "0.4.75",
        "rcp-fe-lol-patcher": "0.1.219",
        "rcp-fe-lol-parties": "0.7.329",
        "rcp-fe-lol-regalia": "0.6.6",
        "rcp-fe-lol-league-tier-names": "0.0.49",
        "rcp-fe-lol-loot": "0.1.2143",
        "rcp-fe-lol-navigation": "0.0.318"
    },
    "riotMeta": {
        "type": "frontend",
        "app": "lol",
        "feature": "Teamfight Tactics",
        "hasBundledAssets": true,
        "globalAssetBundles": [
            "assets.wad"
        ]
    }
}
  1. node index.js

then have problems

PS F:\git\github download\lol-wad-parser-master\lol> node .\index.js
fs.js:27
const { Math, Object } = primordials;
                         ^

ReferenceError: primordials is not defined
    at fs.js:27:26
    at req_ (F:\git\github download\lol-wad-parser-master\lol\node_modules\natives\index.js:143:24)
    at Object.req [as require] (F:\git\github download\lol-wad-parser-master\lol\node_modules\natives\index.js:55:10)
    at Object.<anonymous> (F:\git\github download\lol-wad-parser-master\lol\node_modules\xp-fs\node_modules\graceful-fs\fs.js:1:37)
    at Module._compile (internal/modules/cjs/loader.js:759:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
    at Module.load (internal/modules/cjs/loader.js:628:32)
    at Function.Module._load (internal/modules/cjs/loader.js:555:12)
    at Module.require (internal/modules/cjs/loader.js:666:19)
    at require (internal/modules/cjs/helpers.js:16:16)
PS F:\git\github download\lol-wad-parser-master\lol>

Pupix commented

The problem seems to be with some old dependencies and newer versions of node.

As for the .dat file, they are there because Ravioli couldn't understand the format of the file. It's right there in the changelog

  • Files with the same identifiers would have the same file names. The file extensions are determined from the content.
  • Files with unidentified content are assigned the file extension ".dat".