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

manifest type error: Type 'string' is not assignable to type '"module"' #914

Open
2 tasks
hichemfantar opened this issue Sep 3, 2024 · 3 comments · May be fixed by #916
Open
2 tasks

manifest type error: Type 'string' is not assignable to type '"module"' #914

hichemfantar opened this issue Sep 3, 2024 · 3 comments · May be fixed by #916

Comments

@hichemfantar
Copy link

hichemfantar commented Sep 3, 2024

Build tool

Vite

Where do you see the problem?

  • In the browser
  • In the terminal

Describe the bug

Documentation says we should include type:"module" to the background service worker but the types don't like this.

image

image

Reproduction

https://crxjs.dev/vite-plugin/concepts/background

Logs

No response

System Info

  System:
    OS: Windows 10 10.0.19045
    CPU: (12) x64 Intel(R) Core(TM) i5-10500H CPU @ 2.50GHz
    Memory: 5.42 GB / 15.78 GB
  Binaries:
    Node: 18.18.2 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.21 - C:\Program Files\nodejs\yarn.CMD
    npm: 9.8.1 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.5.0 - C:\Program Files\nodejs\pnpm.CMD
  Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.19041.4355
  npmPackages:
    @crxjs/vite-plugin: ^1.0.14 => 1.0.14
    vite: ^2.9.9 => 2.9.18

Severity

annoyance

@hichemfantar
Copy link
Author

issue seems to be fixed by removing background.type since it seems to be auto generated on build anyway

@Toumash
Copy link

Toumash commented Sep 7, 2024

Just use the typed manifest from crxjs and not the json one

import { crx, defineManifest } from '@crxjs/vite-plugin';
  return defineManifest({
version: packageJson.version,
    manifest_version: 3,
    name: 'name,
    description:
      'desc',
    content_scripts: [
      {

@hichemfantar
Copy link
Author

Just use the typed manifest from crxjs and not the json one

import { crx, defineManifest } from '@crxjs/vite-plugin';
  return defineManifest({
version: packageJson.version,
    manifest_version: 3,
    name: 'name,
    description:
      'desc',
    content_scripts: [
      {

the problem here as well is that the type property is breaking v3 extension installation in firefox. check out #813

lasuillard added a commit to lasuillard/raindrop-sync-chrome that referenced this issue Sep 25, 2024
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

Successfully merging a pull request may close this issue.

2 participants