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

Maximum call stack size exceeded when trying to convert pixi.js v8. #11

Open
Ayfri opened this issue Oct 22, 2023 · 5 comments
Open

Maximum call stack size exceeded when trying to convert pixi.js v8. #11

Ayfri opened this issue Oct 22, 2023 · 5 comments

Comments

@Ayfri
Copy link

Ayfri commented Oct 22, 2023

Hello, I'm trying to convert PIXI.js v8 with the following configuration :

{
	"input": "node_modules/pixi.js/lib/**/*.d.ts",
	"output": "dist",
	"libraryName": "pixi.js"
}

But I'm getting the following error :

file:///C:/Users/MyUser/IdeaProjects/random/karakum-test/node_modules/karakum/build/utils/fileName.js:17
    return commonPrefix(common, ...rest);
           ^

RangeError: Maximum call stack size exceeded
    at commonPrefix (file:///C:/Users/MyUser/IdeaProjects/random/karakum-test/node_modules/karakum/build/utils/fileName.js:17:12)
    at commonPrefix (file:///C:/Users/MyUser/IdeaProjects/random/karakum-test/node_modules/karakum/build/utils/fileName.js:17:12)
    at commonPrefix (file:///C:/Users/MyUser/IdeaProjects/random/karakum-test/node_modules/karakum/build/utils/fileName.js:17:12)
    at commonPrefix (file:///C:/Users/MyUser/IdeaProjects/random/karakum-test/node_modules/karakum/build/utils/fileName.js:17:12)
    at commonPrefix (file:///C:/Users/MyUser/IdeaProjects/random/karakum-test/node_modules/karakum/build/utils/fileName.js:17:12)
    at commonPrefix (file:///C:/Users/MyUser/IdeaProjects/random/karakum-test/node_modules/karakum/build/utils/fileName.js:17:12)
    at commonPrefix (file:///C:/Users/MyUser/IdeaProjects/random/karakum-test/node_modules/karakum/build/utils/fileName.js:17:12)

Here is my package.json :

{
	"name": "karakum-test",
	"version": "1.0.0",
	"scripts": {
		"start": "karakum --config karakum.config.json"
	},
	"dependencies": {
		"pixi.js": "^8.0.0-beta.6"
	},
	"devDependencies": {
		"karakum": "^1.0.0-alpha.25",
		"typescript": "^5.2.2"
	}
}
@sgrishchenko
Copy link
Contributor

Thank you for the report. I will check what is wrong with this commonPrefix helper.

@sgrishchenko
Copy link
Contributor

@Ayfri I removed recursion in the commonPrefix helper. It is used only for detection of common file root that can be set up manually using inputRoots config option, so also now I compute common root lazily only if inputRoots is not specified. All changes are published, so you can check them.

But to be honest, I didn't reproduce your problem. After running of Karakum for your setup, I received only two files

/dist/filters.kt
/dist/index.kt

I noticed that index.kt re-exports a lot of stuff, so maybe the number of reexported files causes the issue with recursion?
It would be great if you provide more details about your conversion. Maybe I will even add you configs as an example in Karakum repository.

@sgrishchenko
Copy link
Contributor

Sorry, I used v7 of PIXI.js, that is why the number of files was so small. I tested it with v8 and now I see, the number of files is really big. I still didn't reproduce it on Linux (I don't know why), but I will try to do it on Windows later.

@Ayfri
Copy link
Author

Ayfri commented Nov 3, 2023

@sgrishchenko Have you had time to test ?

@sgrishchenko
Copy link
Contributor

No, I didn't yet, but I already published a fix, that should solve this issue. You can try a new Karakum version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants