angular / angular

Deliver web apps with confidence 🚀
https://angular.dev
MIT License
94.71k stars 24.68k forks source link

Help me - could not resolve module angular/node_modules/mermaid/dist/mermaid.js #55657

Closed fendypurnomo closed 1 week ago

fendypurnomo commented 2 weeks ago

Describe the problem that you experienced

Administrator@DESKTOP-19BVUE8 MINGW64 /d/Applications/docs/angular.io
$ yarn run docs
yarn run v1.22.19

warning You don't appear to have an internet connection. Try the --offline flag to use the cache for registry queries.
$ [[ -n $CI ]] && echo 'Cannot run this yarn script on CI' && exit 1 || yarn bazel run //adev:serve --fast_adev
'[[' is not recognized as an internal or external command,
operable program or batch file.

warning You don't appear to have an internet connection. Try the --offline flag to use the cache for registry queries.
$ D:\Applications\docs\angular.io\node_modules\.bin\bazel run //adev:serve --fast_adev    
Starting local Bazel server and connecting to it...
... still trying to connect to local Bazel server after 10 seconds ...
INFO: Analyzed target //adev:serve (1384 packages loaded, 84466 targets configured).      
INFO: Found 1 target...
INFO: From Bundling JavaScript packages/core/primitives/event-dispatch/contract_bundle.js 
[rollup]:

bazel-out/x64_windows-fastbuild-ST-2e5f3376adb5/bin/packages/core/primitives/event-dispatch/contract_binary.mjs → bazel-out/x64_windows-fastbuild-ST-2e5f3376adb5/bin/packages/core/primitives/event-dispatch/contract_bundle.js...
created bazel-out/x64_windows-fastbuild-ST-2e5f3376adb5/bin/packages/core/primitives/event-dispatch/contract_bundle.js in 1.1s

ERROR: D:/applications/docs/angular.io/adev/src/content/guide/components/BUILD.bazel:3:16: Action adev/src/content/guide/components/advanced-configuration.md.html failed: (Exit 1): markdown.bat failed: error executing command bazel-out\x64_windows-opt-exec-2B5CBBC6\bin\external\npm\@angular\docs\pipeline\markdown.bat ... (remaining 2 arguments skipped)      
Error: could not resolve module angular/node_modules/mermaid/dist/mermaid.js
Please report this to https://github.com/markedjs/marked.
    at Runfiles.resolve (file:///D:/programs/vcs/git/cmd/_bazel_administrator/qjhjlh55/execroot/angular/external/npm/@angular/docs/pipeline/guides.mjs:48611:19)
    at Runfiles.resolveWorkspaceRelative (file:///D:/programs/vcs/git/cmd/_bazel_administrator/qjhjlh55/execroot/angular/external/npm/@angular/docs/pipeline/guides.mjs:48620:21)   
    at getMermaidScriptTagData (file:///D:/programs/vcs/git/cmd/_bazel_administrator/qjhjlh55/execroot/angular/external/npm/@angular/docs/pipeline/guides.mjs:48699:36)
    at Object.processMermaidCodeBlock (file:///D:/programs/vcs/git/cmd/_bazel_administrator/qjhjlh55/execroot/angular/external/npm/@angular/docs/pipeline/guides.mjs:48712:29)      
    at runNextTicks (node:internal/process/task_queues:60:5)
    at processImmediate (node:internal/timers:447:9)
    at async Promise.all (index 265)
    at main (file:///D:/programs/vcs/git/cmd/_bazel_administrator/qjhjlh55/execroot/angular/external/npm/@angular/docs/pipeline/guides.mjs:52239:31)

ERROR: D:/applications/docs/angular.io/adev/src/content/introduction/essentials/BUILD.bazel:3:16: Action adev/src/content/introduction/essentials/components.md.html failed: (Exit 1): markdown.bat failed: error executing command bazel-out\x64_windows-opt-exec-2B5CBBC6\bin\external\npm\@angular\docs\pipeline\markdown.bat bazel-out/x64_windows-fastbuild/bin/adev/src/content/introduction/essentials/components.md.html-0.params ... (remaining 1 argument skipped)
Error: could not resolve module angular/node_modules/mermaid/dist/mermaid.js
Please report this to https://github.com/markedjs/marked.
    at Runfiles.resolve (file:///D:/programs/vcs/git/cmd/_bazel_administrator/qjhjlh55/execroot/angular/external/npm/@angular/docs/pipeline/guides.mjs:48611:19)
    at Runfiles.resolveWorkspaceRelative (file:///D:/programs/vcs/git/cmd/_bazel_administrator/qjhjlh55/execroot/angular/external/npm/@angular/docs/pipeline/guides.mjs:48620:21)   
    at getMermaidScriptTagData (file:///D:/programs/vcs/git/cmd/_bazel_administrator/qjhjlh55/execroot/angular/external/npm/@angular/docs/pipeline/guides.mjs:48699:36)
    at Object.processMermaidCodeBlock (file:///D:/programs/vcs/git/cmd/_bazel_administrator/qjhjlh55/execroot/angular/external/npm/@angular/docs/pipeline/guides.mjs:48712:29)      
    at async Promise.all (index 7)
    at main (file:///D:/programs/vcs/git/cmd/_bazel_administrator/qjhjlh55/execroot/angular/external/npm/@angular/docs/pipeline/guides.mjs:52239:31)
Target //adev:serve failed to build    
Use --verbose_failures to see the command lines of failed build steps.

ERROR: D:/applications/docs/angular.io/adev/src/assets/BUILD.bazel:5:18 Copying files to directory failed: (Exit 1): markdown.bat failed: error executing command bazel-out\x64_windows-opt-exec-2B5CBBC6\bin\external\npm\@angular\docs\pipeline\markdown.bat bazel-out/x64_windows-fastbuild/bin/adev/src/content/introduction/essentials/components.md.html-0.params 
... (remaining 1 argument skipped)

INFO: Elapsed time: 1630.401s, Critical Path: 344.29s
INFO: 725 processes: 50 internal, 426 local, 249 worker.
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.      
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
JeanMeche commented 2 weeks ago

Hi, can you check if mermaid is present in your node_modules ?

alan-agius4 commented 2 weeks ago

I suspect that https://github.com/angular/dev-infra/pull/2047 should fix it.

alan-agius4 commented 2 weeks ago

Can you please verify if the problem is solved?

devversion commented 1 week ago

I think the issue is that angular/dev-infra resolves mermaid incorrectly. It should resolve from npm/node_modules/mermaid (a bazel rootpath that also works on Windows).

@fendypurnomo feel free to try sending a PR in angular/dev-infra