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

Path contains invalid characters #907

Open
1 of 2 tasks
andriy-panchiy opened this issue Jul 16, 2024 · 2 comments
Open
1 of 2 tasks

Path contains invalid characters #907

andriy-panchiy opened this issue Jul 16, 2024 · 2 comments

Comments

@andriy-panchiy
Copy link

Build tool

Vite

Where do you see the problem?

  • In the browser
  • In the terminal

Describe the bug

I get a path error where for some reason the wrong path is returned to me:

Path contains invalid characters: E:/programming/github/andriy-panchiy/crx-bug-report-repo/E:\programming\github\andriy-panchiy\crx-bug-report-repo\dist/content

Reproduction

https://github.com/andriy-panchiy/crx-bug-report-repo

Logs

PS E:\programming\github\chromane\wildhero-chrome-extension> npm run dev

> [email protected] dev
> run-s clean && vite --config vite.config.dev.ts


> [email protected] clean
> run-p clean:*


> [email protected] clean:dist
> rimraf dist


> [email protected] clean:dist_firefox
> rimraf dist_firefox

[vite-plugin-static-copy] Collected 2 items.

  VITE v4.5.3  ready in 649 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
  ➜  press h to show help
E:\programming\github\chromane\wildhero-chrome-extension\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:/programming/github/chromane/wildhero-chrome-extension/E:\programming\github\chromane\wildhero-chrome-extension\dist/content
    at checkPath (E:\programming\github\chromane\wildhero-chrome-extension\node_modules\@crxjs\vite-plugin\node_modules\fs-extra\lib\mkdirs\utils.js:16:21)
    at module.exports.makeDir (E:\programming\github\chromane\wildhero-chrome-extension\node_modules\@crxjs\vite-plugin\node_modules\fs-extra\lib\mkdirs\make-dir.js:12:3)
    at Object.<anonymous> (E:\programming\github\chromane\wildhero-chrome-extension\node_modules\universalify\index.js:21:10)
    at E:\programming\github\chromane\wildhero-chrome-extension\node_modules\@crxjs\vite-plugin\node_modules\fs-extra\lib\output-file\index.js:20:11
    at E:\programming\github\chromane\wildhero-chrome-extension\node_modules\universalify\index.js:21:38 {
  code: 'EINVAL'
}

Node.js v21.5.0

System Info

System:
  OS: Windows 10 10.0.19045
  CPU: (20) x64 Intel(R) Core(TM) i9-10850K CPU @ 3.60GHz
  Memory: 12.42 GB / 31.92 GB
Binaries:
  Node: 21.5.0 - C:\Program Files\nodejs\node.EXE
  Yarn: 1.22.22 - C:\Program Files\nodejs\yarn.CMD
  npm: 10.8.1 - C:\Program Files\nodejs\npm.CMD
  pnpm: 8.11.0 - ~\AppData\Local\pnpm\pnpm.EXE
Browsers:
  Edge: Chromium (126.0.2592.102)
  Internet Explorer: 11.0.19041.4355

Severity

blocking all usage of RPCE

@Toumash
Copy link

Toumash commented Jul 16, 2024

No idea if thats related but one thing i see is that the dist folder is defined differently from others
outDir: normalizePath(resolve(__dirname, 'dist')), as folder instead of ./folder for instance '@': normalizePath(resolve(__dirname, './')),

@SethBurkart123
Copy link

SethBurkart123 commented Oct 2, 2024

I had the same issue, and It's got to do with the fact that you are giving it a custom outDir, i'm not sure how else to fix it for now other than removing the outDir option under build in your vite config.

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

3 participants