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

Error: EISDIR: illegal operation on a directory, read when running rollup -c #186

Closed
1 of 2 tasks
amiregelz opened this issue Jan 17, 2022 · 8 comments
Closed
1 of 2 tasks
Labels
bug Something isn't working vite-plugin Related to Vite plugin

Comments

@amiregelz
Copy link

Build tool

Rollup

Where do you see the problem?

  • In the browser
  • In the terminal

Describe the bug

Trying RPCE for the first time and using the simple starter snippet from the Usage section.
When I run rollup -c I am getting this cryptic error:

> rollup -c --validate

manifest.json → build...
[!] (plugin chrome-extension) Error: EISDIR: illegal operation on a directory, read
Error: EISDIR: illegal operation on a directory, read

I tried both on Windows and on Linux (mac).

This is my rollup.config.js:

import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'

import { chromeExtension, simpleReloader } from 'rollup-plugin-chrome-extension'

export default {
    input: 'manifest.json',
    output: {
        dir: 'build',
        format: 'esm',
    },
    plugins: [
        // always put chromeExtension() before other plugins
        chromeExtension(),
        simpleReloader(),
        // the plugins below are optional
        resolve(),
        commonjs(),
    ],
}

My manifest.json is standard as well:

{
  "manifest_version": 2,
  "permissions": [
    ...
  ],
  "background": {
    "scripts": [
      "background_script/background.js"
    ]
  },
  "content_scripts": [
    {
      "matches": [
        "https://website.com/*"
      ],
      "js": [
        "content_script/content.js"
      ],
      "css": [
        "content_script/css/style.css"
      ]
    }
  ],
  "browser_action": {
    "default_title": "title",
    "default_icon": {
      "16": "static/icons/16.png",
      "32": "static/icons/32.png"
    }
  },
  "icons": {
    "16": "static/icons/16.png",
    "32": "static/icons/32.png",
    "48": "static/icons/48.png",
    "128": "static/icons/128.png"
  },
  "web_accessible_resources": [
    "static/*"
  ]
}

What should I investigate?

Reproduction

Just the basic usage example. my repo is private but is there anything I should investigate?

Logs

No response

System Info

System:
    OS: Windows 10 10.0.17763
    CPU: (4) x64 Intel(R) Core(TM) i3-7100 CPU @ 3.90GHz
    Memory: 1.01 GB / 7.89 GB
  Binaries:
    Node: 14.16.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.6.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.14.11 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 97.0.4692.71
    Edge: Spartan (44.17763.831.0)
    Internet Explorer: 11.0.17763.771

Severity

blocking all usage of RPCE

@jacksteamdev
Copy link
Contributor

Hard to say without more info. The manifest looks good. It seems that Rollup is trying to read a directory as a file.

What version of RPCE are you using?

@jacksteamdev jacksteamdev added awaiting-feedback Further information is requested bug Something isn't working and removed awaiting-feedback Further information is requested labels Jan 26, 2022
@amiregelz
Copy link
Author

The latest, tried both beta and stable

@jacksteamdev jacksteamdev added vite-plugin Related to Vite plugin and removed awaiting-feedback Further information is requested labels Feb 6, 2022
@jacksteamdev
Copy link
Contributor

@amiregelz I've done a major rewrite, would you mind giving it a try?

The API has changed a little, you can see the updated instructions on DEV:

Create a Vite-React Chrome Extension in 90 seconds - DEV Community 👩‍💻👨‍💻

@flurrux
Copy link

flurrux commented Mar 17, 2022

i had the same problem as amiregelz and after following your vite-react tutorial it now works.
it didn't work right away though, only after these two changes:

now it works like a charm!

@jacksteamdev can i also just say that your blog post and comments are such a joy to read. i find them very comprehensible and user friendly. thank you for the effort you put into it all :)

@jacksteamdev
Copy link
Contributor

@flurrux Thanks for your kind words! Comments like yours make all the difference. 🤗

We probably need to add some validation, since manifest version 2 isn't supported.

@jacksteamdev
Copy link
Contributor

Added MV3 validation in #258

@jacksteamdev
Copy link
Contributor

moving all of my icons to the top-level ./public folder as suggested

Added auto-copy for missing manifest assets in #259

@jacksteamdev
Copy link
Contributor

It appears that this issue is now primarily a duplicate of #137, closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working vite-plugin Related to Vite plugin
Projects
None yet
Development

No branches or pull requests

3 participants