Error with example using react, vite, swc, protobuf #1
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.
Issue
Builds failing when trying to use a
tsconfig.ts
'spaths
alias with ats_proto_library
.Motivation
I don't want to use
copy_files = True
in thets_proto_library
as it litters the source tree with.d.ts
files. I would rather point to thebazel-out
directory instead for the.d.ts
files to allow my IDE to resolve types.I also don't want to use relative paths to protos in the workspace. I would prefer to either use
paths
aliases or anpm_package
(which I couldn't get to work either for what I think is the same reason).Steps
(286306e) I started by copying one of the existing examples with only a few changes (npm package versions updated, and a path alias
@/*
to the root of the project.(18e6c69) I started with importing the
proto_grpc
'sts_proto_library
using relative imports. The build works and IDE type resolution works because ofcopy_files = True
by default.(394487a) I set
copy_files = False
and deleted the.d.ts
files from the example from my source tree. The build still works but IDE type resolution fails, as expected since we haven't pointed it tobazel-out
yet.(01cb6ed) I tried to fix resolving the types by using a
path
alias intsconfig.ts
. The build now fails, but IDE type resolution works again due to the paths alias tobazel-out
.Final Build Errors
The path in the error is what stands out to me as weird.
Here's both
preview
andstart
build errors for production and dev build respectively.or
Other
build --modify_execution_info=SWCTranspile=+no-sandbox
to.bazelrc
as advised in the following does not seem to help.@
.~
alias above which makes me suspect the issue is related to..
paths and probably symlinks.