Skip to content

we need to initialize plugins as empty array #1042

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
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

salmin89
Copy link
Contributor

@salmin89 salmin89 commented Jul 7, 2025

else you get this error:

error during build:
Build failed with 1 error:

[plugin crx:manifest-post] /@crx/manifest
TypeError: plugins is not iterable

Copy link

changeset-bot bot commented Jul 7, 2025

⚠️ No Changeset found

Latest commit: 92dc0cc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Jul 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vite-plugin-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 1:38pm

@salmin89
Copy link
Contributor Author

salmin89 commented Jul 7, 2025

if you want to test rolldown in the playground, take react for example and update vite to:

 "vite": "npm:rolldown-vite@latest",

and @vitejs/plugin-react to @vitejs/plugin-react-oxc

--- "@vitejs/plugin-react": "^4.3.4",
+++ "@vitejs/plugin-react-oxc": "^0.2.3",

@FliPPeDround
Copy link
Member

I added rolldown-react under the playgrounds folder. After testing, when running build, the content script was not injected into the page as expected.

@FliPPeDround FliPPeDround requested a review from Toumash July 8, 2025 03:30
@salmin89
Copy link
Contributor Author

salmin89 commented Jul 8, 2025

I added rolldown-react under the playgrounds folder. After testing, when running build, the content script was not injected into the page as expected.

looks like the plugins are not being detected in build mode.
options.plugins is undefined

buildStart(options) {
    if (options.plugins) crxPlugins = options.plugins as CrxPlugin[]
}

@FliPPeDround
Copy link
Member

I added rolldown-react under the playgrounds folder. After testing, when running build, the content script was not injected into the page as expected.

looks like the plugins are not being detected in build mode. options.plugins is undefined

buildStart(options) {
    if (options.plugins) crxPlugins = options.plugins as CrxPlugin[]
}

Yes, in rolldown-vite, the parameters in buildStart are not entirely identical to those in Vite. I'm currently unsure whether rolldown-vite doesn't support crxjs's syntax or if this is a bug in rolldown-vite.

@salmin89
Copy link
Contributor Author

salmin89 commented Jul 8, 2025

I think we can grab the plugins from this hook:

configResolved(config) {
        if (config.plugins) plugins = config.plugins as CrxPlugin[]
},

but even with that in place I'm still getting some errors when building. Same error for building vite6 and vite7 though. I think it might be related to the vite version miss-match in the repo

[crx:web-accessible-resources] TypeError: OutputBundle["manifest.json"] is undefined.

@salmin89
Copy link
Contributor Author

salmin89 commented Jul 8, 2025

upgrading vite-plugin to at least 6 - and silencing some type errors solved the problems, and I managed to get play-rolldown-react to build. I'll push a commit to this PR just for educational purposes

@salmin89
Copy link
Contributor Author

salmin89 commented Jul 8, 2025

@FliPPeDround just pushed the fixes. buildStart still resolves plugins incase you need to build older vite versions.

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 this pull request may close these issues.

2 participants