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

got error when use config.json file #3881

Closed
2 tasks done
dxrobinson opened this issue Jun 14, 2023 · 3 comments
Closed
2 tasks done

got error when use config.json file #3881

dxrobinson opened this issue Jun 14, 2023 · 3 comments
Labels

Comments

@dxrobinson
Copy link

Have you read the documentation?

URL

https://www.sitespeed.io

What are you trying to accomplish

$ sitespeed.io https://www.sitespeed.io --config ./config.json
node:internal/errors:490
ErrorCaptureStackTrace(err);
^

TypeError [ERR_INVALID_URL_SCHEME]: The URL must be of scheme file
at open (node:internal/fs/promises:538:10)
at readFile (node:internal/fs/promises:909:20)
at parseCommandLine (file:///C:/Users/zhaoyang18/AppData/Roaming/npm/node_modules/sitespeed.io/lib/cli/cli.js:2060:13)
at start (file:///C:/Users/zhaoyang18/AppData/Roaming/npm/node_modules/sitespeed.io/bin/sitespeed.js:119:22)
at file:///C:/Users/zhaoyang18/AppData/Roaming/npm/node_modules/sitespeed.io/bin/sitespeed.js:178:7 {
code: 'ERR_INVALID_URL_SCHEME'
}

Node.js v18.16.0

What browser did you use?

Chrome

How to reproduce

just run it in windows platfrom

Relevant log output

No response

@dxrobinson dxrobinson added the bug label Jun 14, 2023
@dxrobinson
Copy link
Author

dxrobinson commented Jun 14, 2023

Take a quick look of the source code, I just change the readfile of config file to readfileSync, and it works well.
I did not look into it why, please help me out later, otherwise I need maintain a version by myself, that really not what I want. thanks a lot.

image

@soulgalore
Copy link
Member

Hi @dxrobinson yeah that looks like bug, hmm, we have some tests for that but it seems broken, let me have a look.

soulgalore added a commit that referenced this issue Jun 14, 2023
soulgalore added a commit that referenced this issue Jun 14, 2023
* Make sure configs are read sync.

Fix for #3881

* lint
@dxrobinson
Copy link
Author

Hi @dxrobinson yeah that looks like bug, hmm, we have some tests for that but it seems broken, let me have a look.

Hi Peter,

My job is a tester, so really great to find a bug for you : )

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

No branches or pull requests

2 participants