fix(types): Add missing type def for isSpaMode in @remix-run/dev/server-build #8511
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
using remix v2.5.0, my
server.ts
file, which starts:triggers the following type error:
looking at
packages/remix-dev/server-build.ts
and similar issues from the past, it seems like the newisSpaMode
option just needs to be added as an export to that file to provide the type definition for the virtual module provided by the Remix compiler at build time. this is the same fix as d7a6fb5 (#4771) but forisSpaMode
. as such, this PR is opened againstmain
(like that PR), but if it should be againstdev
, i’m happy to update it.Testing Strategy:
i manually edited
node_modules/@remix-run/dev/server-build.d.ts
like so:and i manually edited
node_modules/@remix-run/dev/server-build.js
like so (shouldn’t make any different to tsc, i just wanted to be thorough with my testing):with those changes, the typescript errors were resolved.