Skip to content

Not assignable to type 'ManifestV3Export' error #963

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

Open
1 of 2 tasks
thdoan opened this issue Dec 23, 2024 · 3 comments
Open
1 of 2 tasks

Not assignable to type 'ManifestV3Export' error #963

thdoan opened this issue Dec 23, 2024 · 3 comments

Comments

@thdoan
Copy link
Contributor

thdoan commented Dec 23, 2024

Build tool

Vite

Where do you see the problem?

  • In the browser
  • In the terminal

Describe the bug

I am seeing this error in VS Code error log:

Type '{ manifest_version: number; minimum_chrome_version: string; name: string; version: string; author: string; default_locale: string; description: string; homepage_url: string; icons: { "16": string; "32": string; "48": string; "128": string; }; ... 5 more ...; web_accessible_resources: { ...; }[]; }' is not assignable to type 'ManifestV3Export'.
  Type '{ manifest_version: number; minimum_chrome_version: string; name: string; version: string; author: string; default_locale: string; description: string; homepage_url: string; icons: { "16": string; "32": string; "48": string; "128": string; }; ... 5 more ...; web_accessible_resources: { ...; }[]; }' is not assignable to type 'ManifestV3'.
    Types of property 'author' are incompatible.
      Type 'string' is not assignable to type '{ email: string; }'.

Can this be ignored, or is it actually a problem?

Reproduction

It's a private repo, so sorry I cannot provide a link, but the manifest.json looks like this:

{
  "manifest_version": 3,
  "minimum_chrome_version": "99.0",
  "name": "...",
  "version": "0.1.0",
  "author": "...",
  "default_locale": "en",
  "description": "__MSG_generalDescription__",
  "homepage_url": "...",
  "icons": {
    "16": "src/images/icon16.png",
    "32": "src/images/icon32.png",
    "48": "src/images/icon48.png",
    "128": "src/images/icon128.png"
  },
  "action": {
    "default_popup": "src/popup/popup.html",
    "default_icon": {
      "16": "src/images/icon16.png",
      "24": "src/images/icon24.png",
      "32": "src/images/icon32.png"
    }
  },
  "background": {
    "service_worker": "src/background/background.ts"
  },
  "commands": {
    "_execute_action": {}
  },
  "content_security_policy": {
    "extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self';"
  },
  "permissions": [
    "storage"
  ],
  "web_accessible_resources": [
    {
      "matches": ["<all_urls>"],
      "resources": [
        "src/images/*"
      ]
    }
  ]
}

Logs

No response

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
    Memory: 12.36 GB / 31.95 GB
  Binaries:
    Node: 18.20.4 - C:\Program Files\nodejs\node.EXE
    npm: 10.7.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (127.0.2651.74)
  npmPackages:
    @crxjs/vite-plugin: ^2.0.0-beta.28 => 2.0.0-beta.28
    vite: ^5.4.11 => 5.4.11

Severity

annoyance

Copy link
Contributor

Thanks for contributing to CRXJS! This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within 7 days.

@github-actions github-actions bot added the Stale label Mar 23, 2025
@Toumash
Copy link
Collaborator

Toumash commented Mar 23, 2025

Why not specify it according to the structure?
https://developer.chrome.com/docs/extensions/reference/manifest/author
crxjs @ beta - works fine

import { crx, defineManifest } from '@crxjs/vite-plugin';
import { ImportMetaEnv } from './src/app/types/vite-env';
import packageJson from './package.json';

const createManifest = (env: ImportMetaEnv) => {
  return defineManifest({
    version: packageJson.version,
    manifest_version: 3,
    name: 'Something',
    author:{
      email:'test' // no errors
    },

Image

Full sample here: https://github.com/Toumash/react-extension-vite-template/blob/master/vite.config.ts

Copy link
Contributor

⚠️ Important Notice: CRXJS is seeking new maintainers.

  • New issues and PRs may not receive immediate attention
  • A new maintenance team must establish itself by March 31, 2025 or this repository will be archived on June 1, 2025
  • Learn more about the transition

This is an automated message. Please do not reply to this comment.

@github-actions github-actions bot removed the Stale label Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants