Skip to content

[TS] Fix development exports breaking NextJS#3796

Merged
cloutiertyler merged 2 commits intoclockworklabs:masterfrom
kistz:dev-not-deving😠
Dec 2, 2025

Hidden character warning

The head ref may contain hidden characters: "dev-not-deving\ud83d\ude20"
Merged

[TS] Fix development exports breaking NextJS#3796
cloutiertyler merged 2 commits intoclockworklabs:masterfrom
kistz:dev-not-deving😠

Conversation

@kistz
Copy link
Contributor

@kistz kistz commented Nov 30, 2025

Description of Changes

NextJS 15 and 16 do not build without these development exports removed tho they funnily enough have different errors.
image

Upon removing the development export everything works like a charm.
I couldn't find any benefit of having them but maybe @cloutiertyler knows more why those are there in the first place🤷

This can be reproduced if you clone this repo i set up: https://github.com/kistz/spacetime-next-react-hooks
Since its a build error it shouldnt matter if you have the actual module running somewhere.

Step 1: bun install

Step 2: bun dev

Step 3: observe that the error above is appearing (not good)

Step 3: Go into node_modules/spacetimedb/package.json

Step 4: Remove the development fields under exports like in this pr

Step 5: bun dev

Step 6: Profit. (should only be a connection error (aka nothing renders) at this point since the module your trying to connect to is missing)

API and ABI breaking changes

None

Expected complexity level and risk

1

Testing

Not a whole lot since i dont fully grasp the impact of this change but without it i cant even use the spacetimedb package with NextJS and removing them fixes it.
But even development scenarios are working just fine without it.

@cloutiertyler cloutiertyler self-requested a review December 2, 2025 02:28
Copy link
Contributor

@cloutiertyler cloutiertyler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am okay with this change.

For context, this was included so that other packages within our repo that depend on the spacetimedb package could depend on the TypeScript source files directly, rather than depending on a built version of the library. It makes dev slightly easier. If it's causing issues for downstream users though, that's obviously not good though. We'll look for a workaround internally.

@cloutiertyler cloutiertyler added this pull request to the merge queue Dec 2, 2025
Merged via the queue into clockworklabs:master with commit 3cead3d Dec 2, 2025
20 checks passed
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