PlasmoHQ / plasmo

🧩 The Browser Extension Framework
https://www.plasmo.com
MIT License
10.66k stars 370 forks source link

[BUG] Error after upgrading to 0.85.0 - EISDIR: illegal operation on a directory, read #912

Open zorridge opened 8 months ago

zorridge commented 8 months ago

What happened?

I am upgrading from 0.84.1 to 0.85.0 and ran into an EISDIR: illegal operation on a directory, read error when attempting to start the dev server. The project works with no errors on 0.84.1.

Here is my package.json file:

{
  "name": "Name",
  "displayName": "Display Name",
  "version": "0.0.0",
  "description": "Description",
  "author": "Author",
  "scripts": {
    "dev": "plasmo dev",
    "stage": "plasmo build --tag=staging",
    "build": "plasmo build",
    "test": "plasmo test"
  },
  "dependencies": {
    "@plasmohq/messaging": "^0.6.1",
    "@plasmohq/storage": "^1.9.0",
    "lodash": "^4.17.21",
    "plasmo": "^0.85.0",
    "react": "18.2.0",
    "react-dom": "18.2.0"
  },
  "devDependencies": {
    "@types/chrome": "0.0.251",
    "@types/lodash": "^4.14.202",
    "@types/node": "20.9.0",
    "@types/react": "18.2.37",
    "@types/react-dom": "18.2.15",
    "@typescript-eslint/eslint-plugin": "^6.18.1",
    "@typescript-eslint/parser": "^6.18.1",
    "eslint": "^8.56.0",
    "eslint-config-prettier": "^9.1.0",
    "eslint-plugin-prettier": "^5.1.3",
    "eslint-plugin-react": "^7.33.2",
    "eslint-plugin-simple-import-sort": "^10.0.0",
    "prettier": "3.0.3",
    "typescript": "5.2.2"
  },
  "manifest": {
    "host_permissions": [
      "https://*/*",
      "http://localhost:3000/*"
    ]
  }
}

Version

Latest

What OS are you seeing the problem on?

Windows, Linux

What browsers are you seeing the problem on?

No response

Relevant log output

# npm run dev

> plasmo dev

🟣 Plasmo v0.85.0
🔴 The Browser Extension Framework
🔵 INFO   | Starting the extension development server...
🔵 INFO   | Loaded environment variables from: []
🔴 ERROR  | Build failed. To debug, run plasmo dev --verbose.
🔴 ERROR  | EISDIR: illegal operation on a directory, read

# npm run dev -- --verbose
...
🔵 INFO   | Loaded environment variables from: []
🟡 0      | @plasmohq/parcel-transformer-manifest
🟡 1      | Adding icons
🟡 2      | Adding default_icon
🟡 3      | Adding default_popup
🟡 4      | Handling MV3 background service worker
🟡 5      | + Finished transforming manifest
🔴 ERROR  | EISDIR: illegal operation on a directory, read
🟡 41     | Error: EISDIR: illegal operation on a directory, read

(OPTIONAL) Contribution

Code of Conduct

louisgv commented 8 months ago

Thanks for flagging - that's very weird. 0.85.0 added a feature to read in a .parcelrc file, but I don't think it reads any other files :-?...

See diff: https://github.com/PlasmoHQ/plasmo/compare/v0.84.2...v0.85.0

Weird tho, since you're already at the parcel compiling stage, meaning all the pre-compilation is already done..

louisgv commented 8 months ago

Actually, there's this diff: https://github.com/PlasmoHQ/plasmo/compare/v0.84.1...v0.85.0#diff-8adc41bbae120a1daef333e2af6ef7c0fa5d20dd3c9baa06dfb28392905b5658R24-R36

Are you using the data-* scheme? And are you pointing at some directory instead of a file?

zorridge commented 8 months ago

Thanks for the quick answer! You are right, the issue seems to be a line where I am doing import styleText from 'data-text:~features/widget/stylesheets' for a folder structure like such:

image

Changed it to import styleText from 'data-text:~features/widget/stylesheets/index.scss' and it's working