Skip to content

Conversation

@ed-watts-87
Copy link

@ed-watts-87 ed-watts-87 commented Jan 26, 2026

I've found that when bumping tanstack router plugin in our project, that unplugin is not updated along with it, this results in build errors like this:

file:///path/to/node_modules/unplugin/dist/rspack/loaders/transform.js:11
        const res = await plugin.transform.call(Object.assign({}, this._compilation && createBuildContext(this._compiler, this._compilation, this), context), source, id);
                                           ^

TypeError: plugin.transform.call is not a function
    at Object.transform (file:///path/to/node_modules//node_modules/unplugin/dist/rspack/loaders/transform.js:11:37)
    at LOADER_EXECUTION (/path/to/node_modules/@rspack/core/dist/index.js:5520:18)
    at runSyncOrAsync2 (/path/to/node_modules/@rspack/core/dist/index.js:5521:6)
    at node:internal/util:495:21
    at new Promise (<anonymous>)
    at runSyncOrAsync2 (node:internal/util:481:12)
    at isomorphoicRun (/path/to/node_modules/@rspack/core/dist/index.js:6309:23)
    at runLoaders (/path/to/node_modules/@rspack/core/dist/index.js:6365:56)

Updating to 2.3.11 resolves these build errors as the implementation in the RSPack handler has changed somewhere along the way.

Old transform:

async function transform(source, map) {
	const callback = this.async();
	const { plugin } = this.query;
	if (!plugin?.transform) return callback(null, source, map);
	const id = this.resource;
	const context = createContext(this);
	const res = await plugin.transform.call(Object.assign({}, this._compilation && createBuildContext(this._compiler, this._compilation, this), context), source, id);
        // ^^ blows up here as transform is not callable
	if (res == null) callback(null, source, map);
	else if (typeof res !== "string") callback(null, res.code, map == null ? map : res.map || map);
	else callback(null, res, map);
}

New transform:

async function transform(source, map) {
	const callback = this.async();
	const { plugin } = this.query;
	if (!plugin?.transform) return callback(null, source, map);
	const id = this.resource;
	const context = createContext(this);
	const { handler, filter } = normalizeObjectHook("transform", plugin.transform);
	if (!filter(this.resource, source)) return callback(null, source, map);
	try {
		const res = await handler.call(Object.assign({}, this._compilation && createBuildContext(this._compiler, this._compilation, this, map), context), source, id);
                 ^^ handler is callable
		if (res == null) callback(null, source, map);
		else if (typeof res !== "string") callback(null, res.code, map == null ? map : res.map || map);
		else callback(null, res, map);
	} catch (error) {
		if (error instanceof Error) callback(error);
		else callback(new Error(String(error)));
	}
}

Summary by CodeRabbit

  • Chores
    • Updated router plugin dependencies to latest compatible versions for improved stability and compatibility.

✏️ Tip: You can customize this high-level summary in your review settings.

I've found that when bumping tanstack router plugin in our project, that unplugin is not updated along with it, this results in build errors like this:

```
file:///path/to/node_modules/unplugin/dist/rspack/loaders/transform.js:11
        const res = await plugin.transform.call(Object.assign({}, this._compilation && createBuildContext(this._compiler, this._compilation, this), context), source, id);
                                           ^

TypeError: plugin.transform.call is not a function
    at Object.transform (file:///path/to/node_modules//node_modules/unplugin/dist/rspack/loaders/transform.js:11:37)
    at LOADER_EXECUTION (/path/to/node_modules/@rspack/core/dist/index.js:5520:18)
    at runSyncOrAsync2 (/path/to/node_modules/@rspack/core/dist/index.js:5521:6)
    at node:internal/util:495:21
    at new Promise (<anonymous>)
    at runSyncOrAsync2 (node:internal/util:481:12)
    at isomorphoicRun (/path/to/node_modules/@rspack/core/dist/index.js:6309:23)
    at runLoaders (/path/to/node_modules/@rspack/core/dist/index.js:6365:56)
```

Updating to 2.3.11 resolves these build errors as the implementation in the RSPack handler has changed somewhere along the way.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 26, 2026

📝 Walkthrough

Walkthrough

A dependency version update for the unplugin package from ^2.1.2 to ^2.3.11 in the router-plugin package manifest file with no functional or API-level changes.

Changes

Cohort / File(s) Summary
Dependency Update
packages/router-plugin/package.json
Updated unplugin version constraint from ^2.1.2 to ^2.3.11

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A little bump, a version's climb,
From two-point-one to two-point-three,
The unplugin dances in perfect time,
No breaking changes—just harmony! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: updating the unplugin dependency to version 2.3.11, which directly matches the primary objective of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant