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

Dynamic Scripts break with vite build --watch #990

Open
1 of 2 tasks
salmin89 opened this issue Mar 1, 2025 · 1 comment
Open
1 of 2 tasks

Dynamic Scripts break with vite build --watch #990

salmin89 opened this issue Mar 1, 2025 · 1 comment

Comments

@salmin89
Copy link

salmin89 commented Mar 1, 2025

Build tool

Rollup

Where do you see the problem?

  • In the browser
  • In the terminal

Describe the bug

When developing for Firefox and Safari I use vite build --watch
The initial build works, but once you make a change and save, it breaks in terminal.

[crx:content-scripts] Plugin error - Unable to get file name for unknown file "CjI6$MfX".

Reproduction

  • everything vanilla
  • package.json
"scripts": {
    "dev": "vite build --watch",
},
  • content.ts (content script or background doesn't matter).
import foo from './foo?script'

run once, then edit a file and save.

Logs

System Info

System:
    OS: macOS 14.7.4
    CPU: (12) arm64 Apple M2 Pro
    Memory: 178.16 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.20.0 - ~/.nvm/versions/node/v18.20.0/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v18.20.0/bin/yarn
    npm: 10.9.0 - ~/.nvm/versions/node/v18.20.0/bin/npm
    pnpm: 10.4.1 - ~/.nvm/versions/node/v18.20.0/bin/pnpm
    bun: 1.1.21 - /opt/homebrew/bin/bun
  Browsers:
    Brave Browser: 133.1.75.181
    Chrome: 133.0.6943.142
    Chrome Canary: 135.0.7043.0
    Edge: 133.0.3065.92
    Safari: 18.3
  npmPackages:
    @crxjs/vite-plugin: ^2.0.0-beta.31 => 2.0.0-beta.31 
    vite: ^6.1.0 => 6.2.0

Severity

annoyance

Copy link
Contributor

github-actions bot commented Mar 1, 2025

⚠️ 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.

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

1 participant