fix(config): improved warning when root path includes bad characters#15761
fix(config): improved warning when root path includes bad characters#15761patak-cat merged 12 commits intovitejs:mainfrom poppa:main
Conversation
Previously a warning was only issued when the root path included the `#` character, but the `?` character is equally bad.
|
|
This is pretty much a dummy commit to get the CI checks to run again. The previous one failed, I would say, intermittently and unrelated to any code changes.
|
I can't see that the failing test on Windows has anything to do with this PR? |
Build&Test broke on Windows with the following error: ``` jq: error: syntax error, unexpected INVALID_CHARACTER (Windows cmd shell quoting issues?) at <top-level>, line 1: .[0].devDependencies[\"playwright-chromium\"].version ``` Seems strange this would break now since the escaped quotes had been there for at least 14 months.
Well, that was something unrelated, which I seem to have fixed. |
|
So, how does this error happen? There seems to be some intermittent errors occuring in the test suite overall. I get this intermittently when running the test suite locally: |
| run: | | ||
| echo "PLAYWRIGHT_BROWSERS_PATH=$HOME\.cache\playwright-bin" >> $env:GITHUB_ENV | ||
| $env:PLAYWRIGHT_VERSION="$(pnpm ls --depth 0 --json -w playwright-chromium | jq --raw-output '.[0].devDependencies[\"playwright-chromium\"].version')" | ||
| $env:PLAYWRIGHT_VERSION="$(pnpm ls --depth 0 --json -w playwright-chromium | jq --raw-output '.[0].devDependencies["playwright-chromium"].version')" |
There was a problem hiding this comment.
Thanks for fixing this! The issue has been haunting us in CI for many weeks now.
| const logger = createLogger('info') | ||
| logger.warn = (str) => { | ||
| expect(normalizeString(str)).toEqual( | ||
| 'The project root contains the "?" character (/inc?udes), which may ' + |
There was a problem hiding this comment.
I think we may be introducing to many, too specific, tests here for this feature. I would be ok with a single one and to have a includes instead of equal test so we avoid having to maintain all this in sync if we later change the wording.
There was a problem hiding this comment.
Agree 👍 I moved this as a unit test with only a single.
patak-cat
left a comment
There was a problem hiding this comment.
ok, let's merge it so we can unblock CI for others
Previously a warning was only issued when the root path included the
#character, but the?character is equally bad.Description
This should fix #15726.
Root paths can not include the
#nor the?character. ESM is using URLs to resolve imports, and in an URL what follows those characters is not part of the path.Additional context
I saw there's another PR for this (#15755), but this PR is a bit more elaborative and includes some tests as well.
What is the purpose of this pull request?
I would consider it an overall improvement.
Before submitting the PR, please make sure you do the following
fixes #123).