evanw / evanw/esbuild

Esbuild-wasm fails on angular optimization on s390x

Open
#3,598 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
40.1k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

I cant seem to find the correct source of this problem here. Im trying to build an angular application on z and everytime the optimization is enabled I get this error. The error goes away when optimization is disabled which I dont want to do. Any clue on why this error shows up?

```
ERROR in Optimization error [main.7d29a25361c73fea.js]: Error: open /tmp/esbuild-294b92d156a40204c6b71e48505033c5cd3db58fef43db7bbe12abba1340ecee: Invalid argument
at ui/node_modules/esbuild-wasm/lib/main.js:806:29
at responseCallbacks. (ui/node_modules/esbuild-wasm/lib/main.js:687:9)
at handleIncomingPacket (ui/node_modules/esbuild-wasm/lib/main.js:740:9)
at Socket.readFromStdout (ui/node_modules/esbuild-wasm/lib/main.js:663:7)
at Socket.emit (node:events:517:28)
at addChunk (node:internal/streams/readable:335:12)
at readableAddChunk (node:internal/streams/readable:308:9)
at Readable.push (node:internal/streams/readable:245:10)
at Pipe.onStreamRead (node:internal/stream_base_commons:192:23)
Error: Optimization error [main.7d29a25361c73fea.js]: Error: open /tmp/esbuild-294b92d156a40204c6b71e48505033c5cd3db58fef43db7bbe12abba1340ecee: Invalid argument
at ui/node_modules/esbuild-wasm/lib/main.js:806:29
at responseCallbacks. (ui/node_modules/esbuild-wasm/lib/main.js:687:9)
at handleIncomingPacket (ui/node_modules/esbuild-wasm/lib/main.js:740:9)
at Socket.readFromStdout (ui/node_modules/esbuild-wasm/lib/main.js:663:7)
at Socket.emit (node:events:517:28)
at addChunk (node:internal/streams/readable:335:12)
at readableAddChunk (node:internal/streams/readable:308:9)
at Readable.push (node:internal/streams/readable:245:10)
at Pipe.onStreamRead (node:internal/stream_base_commons:192:23)
at addError (ui/node_modules/@angular-devkit/build-angular/src/utils/webpack-diagnostics.js:16:29)
at ui/node_modules/@angular-devkit/build-angular/src/webpack/plugins/javascript-optimizer-plugin.js:152:64
at async Promise.all (index 5)
at async ui/node_modules/@angular-devkit/build-angular/src/webpack/plugins/javascript-optimizer-plugin.js:155:21
```

```
> ng version

_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/

Angular CLI: 15.2.10
Node: 18.18.2
Package Manager: npm 9.8.1
OS: os390 s390x

Angular: 15.2.10
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1502.10
@angular-devkit/build-angular 15.2.10
@angular-devkit/core 15.2.10
@angular-devkit/schematics 15.2.10
@angular/cdk 15.2.9
@angular/material 15.2.9
@schematics/angular 15.2.10
rxjs 7.8.1
typescript 4.9.5
webpack 5.82.0
```

```
npm ls esbuild-wasm
`-- @angular-devkit/build-angular@15.2.10
`-- esbuild-wasm@0.17.8
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing Angular optimization on the reported os390 s390x environment, then inspect the paths named in the stack trace: ui/node_modules/esbuild-wasm/lib/main.js and @angular-devkit/build-angular/src/utils/webpack-diagnostics.js. Compare optimization-enabled and disabled builds; done means the optimized build completes without the /tmp/esbuild Invalid argument error.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, go, node.js, wasm
Domain
build-system, compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.