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
{{ message }}
Repository navigation
Error building project using artifacts created from angular source code build #46771
Which @angular/* package(s) are the source of the bug?
Don't known / other
Is this a regression?
No
Description
In order to inestigate #13993, first I build angular-cli from source, then installed the tar balls and created a new angular project with it. This was done so that a new angular project is created with the correct dependencies.
Then I followed instructions at thttps://github.com/angular/angular/blob/main/docs/DEVELOPER.md
to copy angular build artifacts over to the newly created project using yarn link. Running "npm start" results in the above error.
I manually updated the javascript bundle where the issue was found and replaced ExternalExpr as suggested in the error message below. When I ran npm start again, I did not get error for ExternalExpr but similar error for another named export. Is there anything I am missing?
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
An unhandled exception occurred: Named export 'ExternalExpr' not found. The requested module '@angular/compiler' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from '@angular/compiler';
const { ExternalExpr, ExternalReference, WrappedNodeExpr } = pkg;
Please provide the environment you discovered this bug in (run ng version)
Are you sure you installed local versions of all Angular packages? I think for us to investigate this, you'll need to provide a repo that demonstrates the issue.
Link locally built artifacts from angular repo to the angular project created earlier.
cd /c/code/angular;
$ yarn ng-dev misc build-and-link ${EXAMPLE_ANGULAR_PROJECT_REPO}
yarn run v1.22.17
$ C:\code\angular\node_modules\.bin\ng-dev misc build-and-link C:/code/github/test
Starting local Bazel server and connecting to it...
C:/users/pvaddepa/_bazel_pvaddepa/mfejoick/execroot/angular/bazel-out/x64_windows-fastbuild/bin
##################################
node_modules\@angular\dev-infra-private\ng-dev\bundles\release\build\build-worker.js:
Building @angular/* npm packages
Mode: false
##################################
Loading: 276 packages loaded
//packages/animations:npm_package
//packages/bazel:npm_package
//packages/common:npm_package
//packages/compiler:npm_package
//packages/compiler-cli:npm_package
//packages/core:npm_package
//packages/elements:npm_package
//packages/forms:npm_package
//packages/language-service:npm_package
//packages/localize:npm_package
//packages/platform-browser:npm_package
//packages/platform-browser-dynamic:npm_package
//packages/platform-server:npm_package
//packages/router:npm_package
//packages/service-worker:npm_package
//packages/upgrade:npm_package
Building in release mode. Resetting the Bazel execroot and action cache..
INFO: Starting clean.
INFO: Analyzed 16 targets (469 packages loaded, 47666 targets configured).
INFO: Found 16 targets...
INFO: From Bundling JavaScript packages/language-service/bundles/language-service.js [rollup]:
(!) Missing shims for Node.js built-ins
Creating a browser bundle that depends on "os", "path" and "url". You might need to include https://
github.com/snowpackjs/rollup-plugin-polyfill-node
INFO: From Executing genrule //packages/common/locales:locale_files:
Writing locales to: bazel-out/x64_windows-fastbuild/bin/packages/common/locales
INFO: Elapsed time: 866.100s, Critical Path: 390.94s
INFO: 878 processes: 482 internal, 110 local, 286 worker.
INFO: Build completed successfully, 878 total actions
# Copy artifacts to C:\code\angular\dist\release-output/animations
# Copy artifacts to C:\code\angular\dist\release-output/bazel
# Copy artifacts to C:\code\angular\dist\release-output/common
# Copy artifacts to C:\code\angular\dist\release-output/compiler
# Copy artifacts to C:\code\angular\dist\release-output/compiler-cli
# Copy artifacts to C:\code\angular\dist\release-output/core
# Copy artifacts to C:\code\angular\dist\release-output/elements
# Copy artifacts to C:\code\angular\dist\release-output/forms
# Copy artifacts to C:\code\angular\dist\release-output/language-service
# Copy artifacts to C:\code\angular\dist\release-output/localize
# Copy artifacts to C:\code\angular\dist\release-output/platform-browser
# Copy artifacts to C:\code\angular\dist\release-output/platform-browser-dynamic
# Copy artifacts to C:\code\angular\dist\release-output/platform-server
# Copy artifacts to C:\code\angular\dist\release-output/router
# Copy artifacts to C:\code\angular\dist\release-output/service-worker
# Copy artifacts to C:\code\angular\dist\release-output/upgrade
✓ Built release output.
warning There's already a package called "@angular/animations" registered. This command has had no e
ffect. If this command was run in another folder with the same name, the other folder is still linke
d. Please run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/animations".
warning There's already a package called "@angular/bazel" registered. This command has had no effect
. If this command was run in another folder with the same name, the other folder is still linked. Pl
ease run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/bazel".
warning There's already a package called "@angular/common" registered. This command has had no effec
t. If this command was run in another folder with the same name, the other folder is still linked. P
lease run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/common".
warning There's already a package called "@angular/compiler" registered. This command has had no eff
ect. If this command was run in another folder with the same name, the other folder is still linked.
Please run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/compiler".
warning There's already a package called "@angular/compiler-cli" registered. This command has had no
effect. If this command was run in another folder with the same name, the other folder is still lin
ked. Please run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/compiler-cli".
warning There's already a package called "@angular/core" registered. This command has had no effect.
If this command was run in another folder with the same name, the other folder is still linked. Ple
ase run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/core".
warning There's already a package called "@angular/elements" registered. This command has had no eff
ect. If this command was run in another folder with the same name, the other folder is still linked.
Please run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/elements".
warning There's already a package called "@angular/forms" registered. This command has had no effect
. If this command was run in another folder with the same name, the other folder is still linked. Pl
ease run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/forms".
warning There's already a package called "@angular/language-service" registered. This command has ha
d no effect. If this command was run in another folder with the same name, the other folder is still
linked. Please run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/language-service".
warning There's already a package called "@angular/localize" registered. This command has had no eff
ect. If this command was run in another folder with the same name, the other folder is still linked.
Please run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/localize".
warning There's already a package called "@angular/platform-browser" registered. This command has ha
d no effect. If this command was run in another folder with the same name, the other folder is still
linked. Please run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/platform-browser".
warning There's already a package called "@angular/platform-browser-dynamic" registered. This comman
d has had no effect. If this command was run in another folder with the same name, the other folder
is still linked. Please run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/platform-browser-dynamic".
warning There's already a package called "@angular/platform-server" registered. This command has had
no effect. If this command was run in another folder with the same name, the other folder is still
linked. Please run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/platform-server".
warning There's already a package called "@angular/router" registered. This command has had no effec
t. If this command was run in another folder with the same name, the other folder is still linked. P
lease run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/router".
warning There's already a package called "@angular/service-worker" registered. This command has had
no effect. If this command was run in another folder with the same name, the other folder is still l
inked. Please run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/service-worker".
warning There's already a package called "@angular/upgrade" registered. This command has had no effe
ct. If this command was run in another folder with the same name, the other folder is still linked.
Please run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/upgrade".
✓ Linked release packages in provided project.
Done in 945.36s.
Attempt to start dev server fails
$ npm start
> [email protected] start C:\code\github\test
> ng serve
An unhandled exception occurred: Named export 'ExternalExpr' not found. The requested module '@angul
ar/compiler' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from '@angular/compiler';
const { ExternalExpr, ExternalReference, WrappedNodeExpr } = pkg;
See "C:\Users\pvaddepa\AppData\Local\Temp\ng-OCRhVe\angular-errors.log" for further details.
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file C:\WINDOWS\system32\cmd.exe
npm ERR! errno ENOENT
npm ERR! [email protected] start: `ng serve`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\pvaddepa\AppData\Roaming\npm-cache\_logs\2022-07-06T19_29_13_736Z-debug.log
warning There's already a package called "@angular/animations" registered. This command has had no e
ffect. If this command was run in another folder with the same name, the other folder is still linke
d. Please run yarn unlink in the other folder if you want to register this folder.
That might mean that you're actually linking a completely different build of the Angular framework packages than the ones you just built from source.
And the warnings indicate that there are pre-existing links. I can't tell from that warning where those links were created, but it may be that you'll first have to unlink from a different directory. It might also be that Yarn reports that warning if the link is already created from within the same directory, in which case the warning is a red-herring.
This would still cause the same error but this time in NGCC. We are spawning NGCC using a child process, which also requires the node option --preserve-symlinks-main to be passed. This gets a bit tricky because we cannot pass it from the command line since this would break the Angular CLI. Therefore, since Angular packages don't need to be NGCC'd you can bypass this by setting BAZEL_TARGET to a truthy value.
Unix Systems
BAZEL_TARGET="1" node --preserve-symlinks node_modules/.bin/ng s
Windows
set BAZEL_TARGET="1" && node --preserve-symlinks node_modules/.bin/ng s
I am assuming that I only need to start the dev server using the command provided, i.e. re-run step 12.
I see a different error now from node.js. The result is same when I run from cmd and git-bash.
`C:\code\github\test>set BAZEL_TARGET="1" && node --preserve-symlinks node_modules/.bin/ng s
C:\code\github\test\node_modules.bin\ng:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list
←[90m at wrapSafe (internal/modules/cjs/loader.js:984:16)←[39m
←[90m at Module._compile (internal/modules/cjs/loader.js:1032:27)←[39m
←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)←[39m
←[90m at Module.load (internal/modules/cjs/loader.js:933:32)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:774:14)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)←[39m
←[90m at internal/main/run_main_module.js:17:47←[39m`
I get the same error with set BAZEL_TARGET="1" && node --preserve-symlinks "node_modules/.bin/ng" s:
`C:\code\github\test>set BAZEL_TARGET="1" && node --preserve-symlinks "node_modules/.bin/ng" s
C:\code\github\test\node_modules.bin\ng:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list
←[90m at wrapSafe (internal/modules/cjs/loader.js:984:16)←[39m
←[90m at Module._compile (internal/modules/cjs/loader.js:1032:27)←[39m
←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)←[39m
←[90m at Module.load (internal/modules/cjs/loader.js:933:32)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:774:14)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)←[39m
←[90m at internal/main/run_main_module.js:17:47←[39m`
Finally, set BAZEL_TARGET="1" && node --preserve-symlinks node_modules/@angular/cli/lib/init.js s worked like a charm! Thanks @alan-agius4
`C:\code\github\test>set BAZEL_TARGET="1" && node --preserve-symlinks node_modules/@angular/cli/lib/init.js s
√ Browser application bundle generation complete.
I have pulled the latest commits from angular repo into my forked repo. The command to build the source code has been updated after I posted raised this issue. The new command is yarn build, introduced as part of Commit fails with the error:
PS C:\code\angular> yarn build yarn run v1.22.17 error Command "build" not found. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I see in package.json, scripts->build target is missing. Do I need to raise separate issue for this?
I have cloned the repo again, ran yarn install and then yarn build fails with the below error when run via Window PowerShell 7.2.5 : yarn run v1.22.17 $ ts-node --esm --project scripts/tsconfig.json scripts/build/build-packages-dist.mts
######################################
Building release packages...
###################################### Starting local Bazel server and connecting to it... Loading: 284 packages loaded //packages/animations:npm_package //packages/bazel:npm_package //packages/common:npm_package //packages/compiler:npm_package //packages/compiler-cli:npm_package //packages/core:npm_package //packages/elements:npm_package //packages/forms:npm_package //packages/language-service:npm_package //packages/localize:npm_package //packages/platform-browser:npm_package //packages/platform-browser-dynamic:npm_package //packages/platform-server:npm_package //packages/router:npm_package //packages/service-worker:npm_package //packages/upgrade:npm_package C:/users/pvaddepa/_bazel_pvaddepa/hwug4sdk/execroot/angular/bazel-out/x64_windows-fastbuild/bin INFO: Analyzed 16 targets (364 packages loaded, 44542 targets configured). INFO: Found 16 targets... ERROR: <builtin>: BazelWorkspaceStatusAction stable-status.txt failed: Failed to determine workspace status: Process exited with status 1 C:\code\angular_new\node_modules\ts-node\src\index.ts:843 return new TSError(diagnosticText, diagnosticCodes, diagnostics); ^ TSError: Γ¿» Unable to compile TypeScript: error TS5083: Cannot read file 'C:\.ng-dev\tsconfig.json'.
at createTSError (C:\code\angular_new\node_modules\ts-node\src\index.ts:843:12)
at reportTSError (C:\code\angular_new\node_modules\ts-node\src\index.ts:847:19)
at createFromPreloadedConfig (C:\code\angular_new\node_modules\ts-node\src\index.ts:858:36)
at create (C:\code\angular_new\node_modules\ts-node\src\index.ts:613:10)
at register (C:\code\angular_new\node_modules\ts-node\src\index.ts:580:15)
at Object.registerAndCreateEsmHooks (C:\code\angular_new\node_modules\ts-node\src\esm.ts:116:34)
at file:///C:/code/angular_new/node_modules/ts-node/esm.mjs:8:7
at ModuleJob.run (internal/modules/esm/module_job.js:183:25)
at async Loader.import (internal/modules/esm/loader.js:178:24)
at async internal/process/esm_loader.js:57:9 {
diagnosticCodes: [ 5083 ]
}
ERROR: C:/code/angular_new/packages/common/BUILD.bazel:36:11 Assembling npm package packages/common/npm_package failed: Failed to determine workspace status: Process exited with status 1 INFO: Elapsed time: 22.438s, Critical Path: 4.82s INFO: 9 processes: 9 internal. FAILED: Build did NOT complete successfully Error: Command failed: yarn -s bazel build --config=snapshot-build //packages/animations:npm_package //packages/bazel:npm_package //packages/common:npm_package //packages/compiler:npm_package //packages/compiler-cli:npm_package //packages/core:npm_package //packages/elements:npm_package //packages/forms:npm_package //packages/language-service:npm_package //packages/localize:npm_package //packages/platform-browser:npm_package //packages/platform-browser-dynamic:npm_package //packages/platform-server:npm_package //packages/router:npm_package //packages/service-worker:npm_package //packages/upgrade:npm_package at checkExecSyncError (child_process.js:790:11) at execSync (child_process.js:863:15) at exec (file:///C:/code/angular_new/scripts/build/package-builder.mts:126:18) at buildReleasePackages (file:///C:/code/angular_new/scripts/build/package-builder.mts:80:3) at performDefaultSnapshotBuild (file:///C:/code/angular_new/scripts/build/package-builder.mts:45:10) at file:///C:/code/angular_new/scripts/build/build-packages-dist.mts:17:1 at ModuleJob.run (internal/modules/esm/module_job.js:183:25) at async Loader.import (internal/modules/esm/loader.js:178:24) at async Object.loadESM (internal/process/esm_loader.js:68:5) { status: 1, signal: null, output: [ null, null, null ], pid: 22872, stdout: null, stderr: null } error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
When I run in Ubuntu using WSL, yarn build works fine.
@alan-agius4 is this the new way of using ng serve if you want to use a local Angular build? node --preserve-symlinks node_modules/.bin/ng s. It worked for me.
If so, I'm available to open a PR with that command to update the documentation. I'm just starting to try to contribute so this is a good first contribution for me.
@alan-agius4 I noticed I had to disable cli cache in angular.json in order to be able to make changes, thus only requiring a ng serve restart. Do you think this is a good addition to the documentation? Any other tips about serving you might share?
Activity
alxhub commentedon Jun 14, 2022
Are you sure you installed local versions of all Angular packages? I think for us to investigate this, you'll need to provide a repo that demonstrates the issue.
bob-watson commentedon Jun 28, 2022
Assigned P5 pending reproduction of issue, after which the priority can be updated as required.
phalgunv commentedon Jul 6, 2022
I have added steps to reproduce the issue. I have run the below command on a Windows 10 machine using git-bash.
Log File:
2022-07-06T19_29_13_736Z-debug.log
It is clear that dev server fails to start after linking the local artifacts from angular build.
JoostK commentedon Jul 6, 2022
This warnings look suspicious:
That might mean that you're actually linking a completely different build of the Angular framework packages than the ones you just built from source.
phalgunv commentedon Jul 7, 2022
I ran the
yarn linkcommand from the same directory containing angular source code.JoostK commentedon Jul 8, 2022
And the warnings indicate that there are pre-existing links. I can't tell from that warning where those links were created, but it may be that you'll first have to unlink from a different directory. It might also be that Yarn reports that warning if the link is already created from within the same directory, in which case the warning is a red-herring.
alan-agius4 commentedon Jul 8, 2022
This is caused by symbolic links being resolved using their real path which eventually would cause node module resolution to fail.
You need to spawn the CLI using
node --preserve-symlinksThis would still cause the same error but this time in NGCC. We are spawning NGCC using a child process, which also requires the node option
--preserve-symlinks-mainto be passed. This gets a bit tricky because we cannot pass it from the command line since this would break the Angular CLI. Therefore, since Angular packages don't need to be NGCC'd you can bypass this by settingBAZEL_TARGETto a truthy value.Unix Systems
Windows
phalgunv commentedon Jul 8, 2022
I am assuming that I only need to start the dev server using the command provided, i.e. re-run step 12.
I see a different error now from node.js. The result is same when I run from cmd and git-bash.
`C:\code\github\test>set BAZEL_TARGET="1" && node --preserve-symlinks node_modules/.bin/ng s
C:\code\github\test\node_modules.bin\ng:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list
←[90m at wrapSafe (internal/modules/cjs/loader.js:984:16)←[39m
←[90m at Module._compile (internal/modules/cjs/loader.js:1032:27)←[39m
←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)←[39m
←[90m at Module.load (internal/modules/cjs/loader.js:933:32)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:774:14)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)←[39m
←[90m at internal/main/run_main_module.js:17:47←[39m`
alan-agius4 commentedon Jul 8, 2022
Can you try the below please?
Or
phalgunv commentedon Jul 8, 2022
I get the same error with
set BAZEL_TARGET="1" && node --preserve-symlinks "node_modules/.bin/ng" s:`C:\code\github\test>set BAZEL_TARGET="1" && node --preserve-symlinks "node_modules/.bin/ng" s
C:\code\github\test\node_modules.bin\ng:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list
←[90m at wrapSafe (internal/modules/cjs/loader.js:984:16)←[39m
←[90m at Module._compile (internal/modules/cjs/loader.js:1032:27)←[39m
←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)←[39m
←[90m at Module.load (internal/modules/cjs/loader.js:933:32)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:774:14)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)←[39m
←[90m at internal/main/run_main_module.js:17:47←[39m`
Finally,
set BAZEL_TARGET="1" && node --preserve-symlinks node_modules/@angular/cli/lib/init.js sworked like a charm! Thanks @alan-agius4`C:\code\github\test>set BAZEL_TARGET="1" && node --preserve-symlinks node_modules/@angular/cli/lib/init.js s
√ Browser application bundle generation complete.
Initial Chunk Files | Names | Raw Size
vendor.js | vendor | 1.74 MB |
polyfills.js | polyfills | 315.33 kB |
styles.css, styles.js | styles | 207.36 kB |
main.js | main | 48.30 kB |
runtime.js | runtime | 6.51 kB |
Build at: 2022-07-08T23:35:27.526Z - Hash: 22eabbc2eb8b501b - Time: 8113ms
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
√ Compiled successfully.`
Does it mean the https://github.com/angular/angular/blob/main/docs/DEVELOPER.md#building needs to be updated?
alan-agius4 commentedon Jul 11, 2022
Yes.
phalgunv commentedon Jul 11, 2022
I have pulled the latest commits from angular repo into my forked repo. The command to build the source code has been updated after I posted raised this issue. The new command is
yarn build, introduced as part of Commit fails with the error:PS C:\code\angular> yarn build yarn run v1.22.17 error Command "build" not found. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.I see in package.json, scripts->build target is missing. Do I need to raise separate issue for this?
JoostK commentedon Jul 11, 2022
The
buildscript does exist:angular/package.json
Line 28 in e58207e
phalgunv commentedon Jul 11, 2022
My bad.
phalgunv commentedon Jul 31, 2022
When I ran "git pull", it incorrectly showed that my local repository was up to date whereas it was stuck at the commit https://github.com/angular/angular/tree/f94c6f433dba3924b79f137cfcc49d2dfd4d679c from 17-June. Since the "build" was added later "yarn build" was failing as it could not find build.
I have cloned the repo again, ran
yarn installand thenyarn buildfails with the below error when run via Window PowerShell 7.2.5 :yarn run v1.22.17 $ ts-node --esm --project scripts/tsconfig.json scripts/build/build-packages-dist.mts######################################
Building release packages...
######################################
Starting local Bazel server and connecting to it... Loading: 284 packages loaded //packages/animations:npm_package //packages/bazel:npm_package //packages/common:npm_package //packages/compiler:npm_package //packages/compiler-cli:npm_package //packages/core:npm_package //packages/elements:npm_package //packages/forms:npm_package //packages/language-service:npm_package //packages/localize:npm_package //packages/platform-browser:npm_package //packages/platform-browser-dynamic:npm_package //packages/platform-server:npm_package //packages/router:npm_package //packages/service-worker:npm_package //packages/upgrade:npm_package C:/users/pvaddepa/_bazel_pvaddepa/hwug4sdk/execroot/angular/bazel-out/x64_windows-fastbuild/bin INFO: Analyzed 16 targets (364 packages loaded, 44542 targets configured). INFO: Found 16 targets... ERROR: <builtin>: BazelWorkspaceStatusAction stable-status.txt failed: Failed to determine workspace status: Process exited with status 1 C:\code\angular_new\node_modules\ts-node\src\index.ts:843 return new TSError(diagnosticText, diagnosticCodes, diagnostics); ^ TSError: Γ¿» Unable to compile TypeScript: error TS5083: Cannot read file 'C:\.ng-dev\tsconfig.json'.ERROR: C:/code/angular_new/packages/common/BUILD.bazel:36:11 Assembling npm package packages/common/npm_package failed: Failed to determine workspace status: Process exited with status 1 INFO: Elapsed time: 22.438s, Critical Path: 4.82s INFO: 9 processes: 9 internal. FAILED: Build did NOT complete successfully Error: Command failed: yarn -s bazel build --config=snapshot-build //packages/animations:npm_package //packages/bazel:npm_package //packages/common:npm_package //packages/compiler:npm_package //packages/compiler-cli:npm_package //packages/core:npm_package //packages/elements:npm_package //packages/forms:npm_package //packages/language-service:npm_package //packages/localize:npm_package //packages/platform-browser:npm_package //packages/platform-browser-dynamic:npm_package //packages/platform-server:npm_package //packages/router:npm_package //packages/service-worker:npm_package //packages/upgrade:npm_package at checkExecSyncError (child_process.js:790:11) at execSync (child_process.js:863:15) at exec (file:///C:/code/angular_new/scripts/build/package-builder.mts:126:18) at buildReleasePackages (file:///C:/code/angular_new/scripts/build/package-builder.mts:80:3) at performDefaultSnapshotBuild (file:///C:/code/angular_new/scripts/build/package-builder.mts:45:10) at file:///C:/code/angular_new/scripts/build/build-packages-dist.mts:17:1 at ModuleJob.run (internal/modules/esm/module_job.js:183:25) at async Loader.import (internal/modules/esm/loader.js:178:24) at async Object.loadESM (internal/process/esm_loader.js:68:5) { status: 1, signal: null, output: [ null, null, null ], pid: 22872, stdout: null, stderr: null } error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.When I run in Ubuntu using WSL,
yarn buildworks fine.fabioemoutinho commentedon Sep 13, 2022
@alan-agius4 is this the new way of using
ng serveif you want to use a local Angular build?node --preserve-symlinks node_modules/.bin/ng s. It worked for me.If so, I'm available to open a PR with that command to update the documentation. I'm just starting to try to contribute so this is a good first contribution for me.
alan-agius4 commentedon Sep 13, 2022
@fabioemoutinho correct note that
sabove is an alias forserveand can be replaced with any Angular CLI command.fabioemoutinho commentedon Sep 13, 2022
@alan-agius4 I noticed I had to disable cli cache in angular.json in order to be able to make changes, thus only requiring a ng serve restart. Do you think this is a good addition to the documentation? Any other tips about serving you might share?
alan-agius4 commentedon Sep 13, 2022
Yeah, you can mention that you need to run
ng cache disable.bob-watson commentedon Sep 27, 2022
It looks like the docs part of this has been resolved.
If so, can we remove the
comp: docslabel?alan-agius4 commentedon Sep 27, 2022
This can actually be closed now since this was only a docs related change.
angular-automatic-lock-bot commentedon Oct 28, 2022
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.