You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Building NextJS projects seems to work with plain JS, but not with Typescript support.
You can try it here.
FYI: NextJS generates artifacts in .next folder. Sources and node_modules still needed to run the NextJS webapp.
It works with nodejs_binary, but no output management.
Can't use npm_package_bin because NextJS build directory has several run-time generated hashed files, or cannot zip it (no cmd attr).
So I ended up using genrule.
Feature requests: what underlying problem are you trying to solve with this feature?
next-cli under genrule with Typescript support.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Here you can find an example project with 2 NextJS appplications:
webapp: NextJS with JS => bazelisk //packages/webapp:start works.
webapp2: NextJS with TS. => bazelist //packages/webapp2:start fail.
What operating system are you running Bazel on?
OSX 10.14.6
What's the output of bazel info release?
release 2.1.1
What's the output of git remote get-url origin ; git rev-parse master ; git rev-parse HEAD ?
Any other information, logs, or outputs that you want to share?
yarn run v1.17.3
$ bazelisk run //packages/webapp2:start
INFO: Analyzed target //packages/webapp2:start (2 packages loaded, 11 targets configu
red).
INFO: Found 1 target...
ERROR: /Users/anthanh/code/github/bazel-js-monorepo/packages/webapp2/BUILD:49:1: Exec
uting genrule //packages/webapp2:build failed (Exit 1) bash failed: error executing c
ommand /bin/bash -c ... (remaining 1 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox
It looks like you're trying to use TypeScript but do not have the required package(s)
installed.
Please install typescript, @types/react, and @types/node by running:
npm install --save-dev typescript @types/react @types/node
If you are not trying to use TypeScript, please remove the tsconfig.json file from your package root (and any TypeScript files).
Creating an optimized production build...
Target //packages/webapp2:start failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 11.772s, Critical Path: 10.94s
INFO: 0 processes.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The text was updated successfully, but these errors were encountered:
anthanh
changed the title
Genrule refuses to build when adding Typescript support: Please install typescript, @types/react, and @types/node
Genrule refuses to build when adding Typescript support
Mar 2, 2020
Description of the problem / feature request:
Hi there!
Building NextJS projects seems to work with plain JS, but not with Typescript support.
You can try it here.
FYI: NextJS generates artifacts in
.next
folder. Sources and node_modules still needed to run the NextJS webapp.It works with
nodejs_binary
, but no output management.Can't use
npm_package_bin
because NextJS build directory has several run-time generated hashed files, or cannot zip it (no cmd attr).So I ended up using
genrule
.Feature requests: what underlying problem are you trying to solve with this feature?
next-cli under genrule with Typescript support.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Here you can find an example project with 2 NextJS appplications:
bazelisk //packages/webapp:start
works.bazelist //packages/webapp2:start
fail.What operating system are you running Bazel on?
OSX 10.14.6
What's the output of
bazel info release
?release 2.1.1
What's the output of
git remote get-url origin ; git rev-parse master ; git rev-parse HEAD
?Have you found anything relevant by searching the web?
Not really, maybe related to this? bazel-contrib/rules_nodejs#312
Any other information, logs, or outputs that you want to share?
The text was updated successfully, but these errors were encountered: