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

Invalid Path Characters Error on yarn dev #69

Open
MiiKOME opened this issue Jun 16, 2024 · 2 comments
Open

Invalid Path Characters Error on yarn dev #69

MiiKOME opened this issue Jun 16, 2024 · 2 comments

Comments

@MiiKOME
Copy link

MiiKOME commented Jun 16, 2024

Description

I encountered an error when attempting to start the development server using yarn dev. The error message indicates that there are invalid characters in the file path, which prevents the server from starting.

Steps to Reproduce

  1. Clone the repository.
  2. Run yarn install to install dependencies.
  3. Run yarn dev to start the development server.

Expected Behavior

The development server should start successfully and listen on the specified port.

Actual Behavior

The following error occurs:

yarn dev
yarn run v1.22.22
$ run-s clean && vite
$ run-p clean:*
$ rimraf dist
$ rimraf dist-firefox-v2

VITE v4.3.9 ready in 878 ms

➜ Local: http://localhost:3573/
➜ Network: use --host to expose
➜ press h to show help
E:\Cex\browser-extension-react-typescript-starter\node_modules@crxjs\vite-plugin\node_modules\fs-extra\lib\mkdirs\utils.js:16
const error = new Error(Path contains invalid characters: ${pth})
^

Error: Path contains invalid characters: E:/Cex/browser-extension-react-typescript-starter/src/E:\Cex\browser-extension-react-typescript-starter\dist/content
at checkPath (E:\Cex\browser-extension-react-typescript-starter\node_modules@crxjs\vite-plugin\node_modules\fs-extra\lib\mkdirs\utils.js:16:21)
at module.exports.makeDir (E:\Cex\browser-extension-react-typescript-starter\node_modules@crxjs\vite-plugin\node_modules\fs-extra\lib\mkdirs\make-dir.js:12:3)
at Object. (E:\Cex\browser-extension-react-typescript-starter\node_modules\universalify\index.js:22:13)
at E:\Cex\browser-extension-react-typescript-starter\node_modules@crxjs\vite-plugin\node_modules\fs-extra\lib\output-file\index.js:20:11
at E:\Cex\browser-extension-react-typescript-starter\node_modules\universalify\index.js:22:54 {
code: 'EINVAL'
}

Node.js v20.6.1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Environment Information

  • Operating System: Windows 10
  • Node.js Version: v20.6.1
  • Yarn Version: 1.22.22
  • Vite Version: 4.3.9

Additional Information

I have tried running the command prompt with administrator privileges, but the issue persists. It seems that there is a mix of forward slashes (/) and backslashes (\) in the file path, which might be causing the issue.

Any guidance or solutions would be greatly appreciated.

@andriy-panchiy
Copy link

UP

@andriy-panchiy
Copy link

I had the following config where I also had this problem:
image

the only thing is that the script: run-s clean && tsc && vite build worked as it should and without errors. Accordingly, I tried changing the code to:
image

this fix helped and now the run-s clean && vite command works but at the same time it broke the run-s clean && tsc && vite build script

also what I noticed is that if you apply the latest change, if you have content_scripts in your manifest with a reference to content/index.tsx, the content folder and all the necessary scripts will not be generated, causing an install error extension that this script was not found

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