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

[BUG] Possible Bug: Incorrect CSS Hash in web_accessible_resources When Building for Edge MV3 #1215

Open
2 of 3 tasks
toFrankie opened this issue Mar 1, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@toFrankie
Copy link

What happened?

Today, I attempted to publish a Chrome Web Store extension to Microsoft Edge and encountered a potential bug.

I built the extension using:

plasmo build --zip --target=edge-mv3

After uploading the ZIP file to Microsoft Partner Center, the submission failed with the following error:

Your package failed certification. Make corrections and certify again.

The following checks failed:
Package acceptance validation error: Manifest file reference 'toc.8ea80c20.css' does not exist in the zip archive. (Note: File locations are case-sensitive)

Upon inspecting the generated manifest.json, I found that the web_accessible_resources field referenced a non-existent CSS file:

{
  "icons": {
    "16": "icon16.plasmo.60403714.png",
    "32": "icon32.plasmo.8e850565.png",
    "48": "icon48.plasmo.37989d43.png",
    "64": "icon64.plasmo.a993afcb.png",
    "128": "icon128.plasmo.9b3294c4.png"
  },
  "manifest_version": 3,
  "action": {
    "default_icon": {
      "16": "icon16.plasmo.60403714.png",
      "32": "icon32.plasmo.8e850565.png",
      "48": "icon48.plasmo.37989d43.png",
      "64": "icon64.plasmo.a993afcb.png",
      "128": "icon128.plasmo.9b3294c4.png"
    },
    "default_popup": "popup.html"
  },
  "version": "1.0.1",
  "author": "Frankie <1426203851@qq.com>",
  "name": "Github Issue TOC",
  "description": "It adds a table of contents to Github's issue pages for quick browsing and content navigation.",
  "background": { "service_worker": "static/background/index.js" },
  "permissions": ["webNavigation"],
  "content_scripts": [
    {
      "matches": ["https://github.com/*"],
      "js": ["toc.060ec9d8.js"],
      "css": ["toc.fa35df8d.css"],
      "run_at": "document_end"
    }
  ],
  "host_permissions": ["https://github.com/*"],
  "web_accessible_resources": [
    { "matches": ["https://github.com/*"], "resources": ["toc.8ea80c20.css"] }
  ]
}

However, the actual file in the ZIP archive was toc.fa35df8d.css.

edge-mv3-prod
├── icon128.plasmo.9b3294c4.png
├── icon16.plasmo.60403714.png
├── icon32.plasmo.8e850565.png
├── icon48.plasmo.37989d43.png
├── icon64.plasmo.a993afcb.png
├── manifest.json
├── popup.c487ea80.css
├── popup.d27f9a89.js
├── popup.html
├── static
│   └── background
│       └── index.js
├── toc.060ec9d8.js
└── toc.fa35df8d.css

The hash in the filename does not match the reference in manifest.json.

This issue also occurs when building for chrome-mv3, but Chrome Web Store does not flag it as an error during upload.

I later discovered that this issue occurs in both plasmo dev and plasmo build, regardless of the target platform.

My extension repository is: github-issue-toc. You can clone it and run:

$ git clone https://github.com/toFrankie/github-issue-toc.git

$ cd github-issue-toc

$ pnpm install

# or pnpm dev
$ pnpm build:edge

Then inspect the generated build/edge-mv3-prod/manifest.json.

Compare the content_scripts and web_accessible_resources fields—
the content_scripts field references a valid toc.<hash>.css, but the corresponding entry in web_accessible_resources points to a non-existent file.

Environment:

  • Plasmo: v0.90.3
  • React: v18.2.0
  • Node.js: v20.10.0
  • OS: macOS 15.3.1

Please take a look, thanks!

Version

Latest

What OS are you seeing the problem on?

MacOSX

What browsers are you seeing the problem on?

Chrome, Microsoft Edge

Relevant log output

Your package failed certification. Make corrections and certify again.

The following checks failed:
Package acceptance validation error: Manifest file reference 'toc.8ea80c20.css' does not exist in the zip archive. (Note: File locations are case-sensitive)

(OPTIONAL) Contribution

  • I would like to fix this BUG via a PR

Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I checked the current issues for duplicate problems.
@toFrankie toFrankie added the bug Something isn't working label Mar 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant