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

It is not possible to build a plugin on Windows #473

Open
GoodSimonVM opened this issue Aug 19, 2022 · 2 comments
Open

It is not possible to build a plugin on Windows #473

GoodSimonVM opened this issue Aug 19, 2022 · 2 comments
Labels
enhancement New feature or request windows Windows compatibility issue

Comments

@GoodSimonVM
Copy link

Describe the problem

Description:
I want to help develop chrome-extension-tools, but it's a bit difficult to get started. I made a fork, downloaded the repository to my computer and installed the packages using "pnpm i". Then I go to "chrome-extension-tools/packages/vite-plugin" and try to build using "pnpm run build", but I get an error message (see output 1).

Do you see this strange paths? (Projects/GitHub/chrome-extension-tools/packages/vite-plugin/D:\Projects\GitHub\chrome-extension-tools\packages\vite-plugin/src/client/html/precont roller.html?client)
I think it's because you use import { posix as path } from "path" in your tscripts. I changed this to import path from "path", and it got better, but it still doesn't work. Now I get an error message (see output 2).

As you can see, Rolap cannot resolve /hmr-content-part.ts?client as esm and ask me to change the output format.

Outputs:
Output 1:

PS D:\Projects\GitHub\chrome-extension-tools\packages\vite-plugin> pnpm run build

> @crxjs/[email protected] build D:\Projects\GitHub\chrome-extension-tools\packages\vite-plugin
> run-s build:clean build:js

> @crxjs/[email protected] build:clean D:\Projects\GitHub\chrome-extension-tools\packages\vite-plugin
> rimraf dist

> @crxjs/[email protected] build:js D:\Projects\GitHub\chrome-extension-tools\packages\vite-plugin
> rollup -c rollup.config.ts --configPlugin esbuild

src/node/index.ts → dist/index.mjs, dist/index.cjs...
[!] (plugin bundleClientCode) Error: Could not load /Projects/GitHub/chrome-extension-tools/packages/vite-plugin/D:\Projects\GitHub\chrome-extension-tools\packages\vite-plugin/src/client/html/precont
roller.html?client (imported by src/node/plugin-fileWriter--pages.ts): ENOENT: no such file or directory, open 'D:\Projects\GitHub\chrome-extension-tools\packages\vite-plugin\D:\Projects\GitHub\chrome-extension-tools\packages\vite-plugin\src\client\html\precontroller.html'                                                                                                                             Error: Could not load /Projects/GitHub/chrome-extension-tools/packages/vite-plugin/D:\Projects\GitHub\chrome-extension-tools\packages\vite-plugin/src/client/html/precontroller.html?client (imported b
y src/node/plugin-fileWriter--pages.ts): ENOENT: no such file or directory, open 'D:\Projects\GitHub\chrome-extension-tools\packages\vite-plugin\D:\Projects\GitHub\chrome-extension-tools\packages\vite-plugin\src\client\html\precontroller.html'                                                                                                                                                           
 ELIFECYCLE  Command failed with exit code 1.
ERROR: "build:js" exited with 1.
 ELIFECYCLE  Command failed with exit code 1.

Output 2:

PS D:\Projects\GitHub\chrome-extension-tools\packages\vite-plugin> pnpm run build

> @crxjs/[email protected] build D:\Projects\GitHub\chrome-extension-tools\packages\vite-plugin
> run-s build:clean build:js

> @crxjs/[email protected] build:clean D:\Projects\GitHub\chrome-extension-tools\packages\vite-plugin
> rimraf dist

> @crxjs/[email protected] build:js D:\Projects\GitHub\chrome-extension-tools\packages\vite-plugin
> rollup -c rollup.config.ts --configPlugin esbuild

src/node/index.ts → dist/index.mjs, dist/index.cjs...
[!] (plugin bundleClientCode) Error: Could not load D:\Projects\GitHub\chrome-extension-tools\packages\vite-plugin\src\client\es/hmr-content-port.ts?client (imported by src/node/plugin-content-script
s.ts): You must specify "output.format", which can be one of "amd", "cjs", "system", "es", "iife" or "umd".                                                                                            https://rollupjs.org/guide/en/#outputformat
Error: Could not load D:\Projects\GitHub\chrome-extension-tools\packages\vite-plugin\src\client\es/hmr-content-port.ts?client (imported by src/node/plugin-content-scripts.ts): You must specify "outpu
t.format", which can be one of "amd", "cjs", "system", "es", "iife" or "umd".                                                                                                                              at error (D:\Projects\GitHub\chrome-extension-tools\node_modules\.pnpm\r[email protected]\node_modules\rollup\dist\shared\rollup.js:198:30)
    at getFormat (D:\Projects\GitHub\chrome-extension-tools\node_modules\.pnpm\r[email protected]\node_modules\rollup\dist\shared\rollup.js:23422:20)
    at normalizeOutputOptions (D:\Projects\GitHub\chrome-extension-tools\node_modules\.pnpm\r[email protected]\node_modules\rollup\dist\shared\rollup.js:23335:20)
    at getOutputOptions (D:\Projects\GitHub\chrome-extension-tools\node_modules\.pnpm\r[email protected]\node_modules\rollup\dist\shared\rollup.js:23717:12)
    at getOutputOptionsAndPluginDriver (D:\Projects\GitHub\chrome-extension-tools\node_modules\.pnpm\r[email protected]\node_modules\rollup\dist\shared\rollup.js:23712:12)
    at handleGenerateWrite (D:\Projects\GitHub\chrome-extension-tools\node_modules\.pnpm\r[email protected]\node_modules\rollup\dist\shared\rollup.js:23687:74)
    at Object.generate (D:\Projects\GitHub\chrome-extension-tools\node_modules\.pnpm\r[email protected]\node_modules\rollup\dist\shared\rollup.js:23649:20)
    at Object.load (D:\Projects\GitHub\chrome-extension-tools\packages\vite-plugin\rollup.config.ts:69:42)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at D:\Projects\GitHub\chrome-extension-tools\node_modules\.pnpm\r[email protected]\node_modules\rollup\dist\shared\rollup.js:22235:83

 ELIFECYCLE  Command failed with exit code 1.
ERROR: "build:js" exited with 1.
 ELIFECYCLE  Command failed with exit code 1.

System Info:

System:
  OS: Windows 10 10.0.19042
  CPU: (12) x64 Intel(R) Core(TM) i5-10500 CPU @ 3.10GHz
  Memory: 5.04 GB / 15.86 GB
Binaries:
  Node: 16.15.1 - D:\Programs\nodejs\node.EXE
  npm: 8.16.0 - ~\AppData\Roaming\npm\npm.CMD
Browsers:
  Edge: Spartan (44.19041.423.0), Chromium (104.0.1293.54)
  Internet Explorer: 11.0.19041.1
npmPackages:
  rollup: ^2.70.2 => 2.72.1
  vite: ^2.9.5 => 2.9.9

Describe the proposed solution

I would like your code to be able to be compiled under windows.

Alternatives considered

I think you could add a detailed description of the system for building your project so that those who want to help can set up a virtual machine.

Importance

nice to have

@GoodSimonVM GoodSimonVM added the enhancement New feature or request label Aug 19, 2022
@AmySteam AmySteam added the windows Windows compatibility issue label Nov 20, 2022
lionelhorn added a commit to lionelhorn/chrome-extension-tools that referenced this issue Jan 20, 2023
@linonetwo
Copy link

import { posix } from 'path'; causes this.

@lionelhorn seems you already fix this, can you PR or release a version?

@myfunc
Copy link

myfunc commented Mar 20, 2024

Hi!
Following up on the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request windows Windows compatibility issue
Projects
None yet
Development

No branches or pull requests

4 participants