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
Does not work on Windows #137
Comments
@onikienko Those watch file paths look suspicious. Would you have time to help debug this? 🙏 This may be the offending code: I added this to support Windows, but Rollup is supposed to use POSIX separators internally. |
A quick tip: The tests take a long time to run altogether, so it might be helpful to debug just one test. I use this VSCode plugin to debug single tests: Jest Runner - Visual Studio Marketplace. It adds a CodeLens to the test file that runs a single test: It may require adding some lines to the VSCode settings file:
XState VizWhen you run the debugger, it should open the XState Visualizer. You can see the progress of the build there. The dropdown lets you select individual files. The paths of the files should be available in the sidebar under "context" |
You are right. It comes from This one is even more complicated: If honest, I have no idea how rollup works 😺 Looks like that |
Rollup configs always accept POSIX, so let's try mapping |
Tried to Looks like the issue is out of my expertise 😅 |
Thanks for working on this! I'm going to remove Looks like |
@onikienko Can you make a PR with the changes you've made? You've done a lot, and I'd like you to get credit for it. |
Nothing to PR. Just a few lines of code. Tests did not pass since rollup hangs on |
Hi @jacksteamdev, I had the same problem running a project on Windows. At the same time on WSL it works great. But maybe it gives you an idea and helps you to fix it in the right way. The problem in my case was here. I change these few lines of code: const dirName = process.cwd();
// and
manifest.id = dirName + "\\manifest.json"; And everything starts working on Windows. |
@Dimirolz This helps a lot! It's good to know we don't have to change lots of things to get this working. |
@onikienko @Dimirolz I've done a major rewrite in v4.0.1-16, would you be interested in giving this another look? The API has changed a little, I've updated the instructions on this DEV article: Create a Vite-React Chrome Extension in 90 seconds - DEV Community 👩💻👨💻 |
@jacksteamdev With v4.0.1-16 > Executing task in folder demo: pnpm run build <
> demo@0.0.0 build X:\Projects\demo
> vite build
vite v2.8.4 building for production...
✓ 16 modules transformed.
rendering chunks (4)...[vite:build-html] The "fileName" or "name" properties of emitted files must be strings that are
neither absolute nor relative paths, received "../../../X:\Projects\demo\index.html".
error during build:
Error: The "fileName" or "name" properties of emitted files must be strings that are neither absolute nor relative paths, received "../../../X:\Projects\demo\index.html".
at error (X:\Projects\demo\node_modules\.pnpm\registry.npmjs.org+rollup@2.68.0\node_modules\rollup\dist\shared\rollup.js:159:30)
at FileEmitter.emitFile (X:\Projects\demo\node_modules\.pnpm\registry.npmjs.org+rollup@2.68.0\node_modules\rollup\dist\shared\rollup.js:15476:24)
at Object.generateBundle (X:\Projects\demo\node_modules\.pnpm\registry.npmjs.org+vite@2.8.4\node_modules\vite\dist\node\chunks\dep-971d9e33.js:21679:22)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
ELIFECYCLE Command failed with exit code 1.
The terminal process "C:\Program Files\PowerShell\7\pwsh.exe -Command pnpm run build" terminated with exit code: 1. vite.config.tsimport { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { chromeExtension } from "rollup-plugin-chrome-extension";
import manifest from './manifest.json'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), chromeExtension({ manifest })],
}) index.html<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html> manifest.json{
"manifest_version": 3,
"name": "Rpce React Vite Example",
"version": "1.0.0",
"action": { "default_popup": "index.html" }
} |
I am having the same issue on Windows 10, can't build our chrome extension in my new machine :( |
I also have the exact same output, on Windows and using the same files as this comment. I'm on latest version 4.0.1-16. I'm totally plucking at straws here but looking at path.d.ts and searching basename within the plugin was where my rabbit hole stopped. It does look like everything is there to be normalising paths for windows but it's not happening. Not an issue from this project but looks related. storybookjs/builder-vite#31 (comment) Windows path issue. |
@DaPotatoMan @pietrofxq @keyeightysix Thanks for the feedback! |
No problem at all @jacksteamdev. I was really surprised and happy to find this project only yesterday after a few weeks of extension land. If there's anything I can do to help debug this issue let me know. |
Also running into this issue--any luck on a workaround? |
I'm also experiencing this issue. Same code working properly via WSL. |
@Stumblinbear @lionelhorn There's a workaround if you modify a local vite file (in node_modules). this.emitFile({
type: 'asset',
fileName: path.basename(shortEmitName),
source: result
}) It's an internal vite issue. I have created an issue here. |
@jacksteamdev Looks like this issue is fixed by #7383 in |
Build tool
Vite
Where do you see the problem?
Describe the bug
dev
andbuild
scripts just hang on theBuilding Chrome Extension files...
It appears on Windows only. When running on Linux everything works as expected.Reproduction
Create a new extension using this guide https://dev.to/jacksteamdev/create-a-vite-react-chrome-extension-in-90-seconds-3df7
Run it on Windows.
Logs
System Info
Severity
blocking all usage of RPCE
The text was updated successfully, but these errors were encountered: