Anyone ever get An unha…

1 minute read

Anyone ever get An unhandled exception occurred: require(...) is not a function when using a custom webpack config with nx build <nest app>?

Responses:

I have tried multiple babel plugins to see if that is the issue but nothing seems to work, I need to supply a custom one to define the number of thread workers otherwise circleCi tries to use 34 workers and errors out:

```cache is affected Starting type checking service… Using 34 workers with 2048MB memory limit

Exited with code exit status 1```

Oh duh the nx cli actually has a config option for maxWorkers when type checking. Ignore me!

Curious we you’d need a babel plugin in general with Nest? Anything specific you want to achieve? :slightly_smiling_face:

You shouldn’t at all. Was just seeing if that would resolve the build error when compiling with the custom webpack. It compiles fine with the nest CLI and nx cli but a soon as I use a custom webpack with the nx CLI it fails with the above error. That error does not crop up when using the custom webpack with nest CLI though

I see - could it be that on CI you have other deps being installed?

It was failing locally

Updated: