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 #178

Closed
BannerBomb opened this issue Oct 21, 2020 · 4 comments
Closed

Maximum call stack size exceeded #178

BannerBomb opened this issue Oct 21, 2020 · 4 comments

Comments

@BannerBomb
Copy link

BannerBomb commented Oct 21, 2020

when I started Visual Studio Code I got this in the output console for npm import version server.

server start
compile: file:///c%3A/Users/Admin/Desktop/Github_Stuff/Discord_Bots/StratoBotElite/branches/master/src/bot/commands/Logging/user-join.js
RangeError: Maximum call stack size exceeded
    at Object.normalize (path.js:265:12)
    at Object.join (path.js:429:18)
    at findPackage (c:\Users\Admin\.vscode\extensions\axetroy.vscode-npm-import-package-version-0.7.5\server\out\utils.js:54:30)
    at findPackage (c:\Users\Admin\.vscode\extensions\axetroy.vscode-npm-import-package-version-0.7.5\server\out\utils.js:60:16)
    at findPackage (c:\Users\Admin\.vscode\extensions\axetroy.vscode-npm-import-package-version-0.7.5\server\out\utils.js:60:16)
    at findPackage (c:\Users\Admin\.vscode\extensions\axetroy.vscode-npm-import-package-version-0.7.5\server\out\utils.js:60:16)
    at findPackage (c:\Users\Admin\.vscode\extensions\axetroy.vscode-npm-import-package-version-0.7.5\server\out\utils.js:60:16)
    at findPackage (c:\Users\Admin\.vscode\extensions\axetroy.vscode-npm-import-package-version-0.7.5\server\out\utils.js:60:16)
    at findPackage (c:\Users\Admin\.vscode\extensions\axetroy.vscode-npm-import-package-version-0.7.5\server\out\utils.js:60:16)
    at findPackage (c:\Users\Admin\.vscode\extensions\axetroy.vscode-npm-import-package-version-0.7.5\server\out\utils.js:60:16)
@cimak
Copy link

cimak commented Nov 24, 2020

Apparently there is some problem with file's URIs on windows:

/**
 * compile the code and return marks
 * @param document
 */
function compile(document) {
    return __awaiter(this, void 0, void 0, function* () {
        const filepath = require("file-uri-to-path")(document.uri);
        
        console.log({
            uri: document.uri,
            filepath,
        });

outputs:

{
  uri: 'file:///c%3A/Users/wilk/.vscode/extensions/axetroy.vscode-npm-import-package-version-0.7.5/server/out/parser/index.js',
  filepath: '\\c%3A\\Users\\wilk\\.vscode\\extensions\\axetroy.vscode-npm-import-package-version-0.7.5\\server\\out\\parser\\index.js'
}

File name starts with "/c:/Users" instead of "c:/Users".

@BannerBomb
Copy link
Author

That's a normal file uri though
image

@BannerBomb
Copy link
Author

BannerBomb commented Nov 24, 2020

ah, it's the percentage afaik.
image

so it's an issue with file-uri-to-path, either the dev of file-uri-to-path or axetroy will need to handle un-escaping the uri.

@BannerBomb
Copy link
Author

BannerBomb commented Nov 24, 2020

Sorry for adding another comment, But according to this comment on the file-uri-to-path package. Nodejs v10 and up have a File uri to path method already built-in also so axetroy could also just remove the dependency and replace it with the built-in method.

const { fileURLToPath } = require('url');
fileURLToPath("file:///c%3A/Users/Admin/Desktop/Github_Stuff/Discord_Bots/StratoBotElite/branches/master/src/bot/commands/Logging/user-join.js")

/* which returns
 /c:/Users/Admin/Desktop/Github_Stuff/Discord_Bots/StratoBotElite/branches/master/src/bot/commands/Logging/user-join.js*/

@axetroy axetroy closed this as completed in c6d9c6f Feb 3, 2021
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