Compiler error (C:\UsersStack too deep. Try compiling with `--via-ir` (cli) or the equivalent `viaIR: true` (standard JSON) while enabling the optimizer

Hello!

I got this error while trying to build this contract that used 1inchV6.sol library.

   --> src/libraries/1inchV6.sol:5600:9:
     |
5600 |         assembly ("memory-safe") {
     |         ^ (Relevant source part starts here and spans across multiple lines).

I have tried the following in the foundry.toml file:

[profile.default]

src = "src"
out = "out"
libs = ["lib"]
evm_version="cancun"
optimizer = true
optimizer_runs = 200
via_ir=true
solc_version = "0.8.23"

Hi, welcome to the community! :wave:

If possible, you can share the whole code at here, so we can try it.