Solution:
disable prebundling all together for dev server
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": { ... }
"defaultConfiguration": "development",
"options": {
"prebundle": false
}
},
after solving prebundling this will lead to the next error
Solution:
mark "util" as external package, this works becuase util is not actually used in web/browser env but still import is enough to annoy the compiler.
"build": {
"builder": "@angular-devkit/build-angular:application",
"options": {
...
...
"styles": ["src/styles.scss"],
"scripts": [],
"externalDependencies": ["util"]
},
}
this will still lead to another error, that looks similar to Error 1 but is not.
Solution:
this is fairly simple to resolve, just add them to the assets array
"build": {
"builder": "@angular-devkit/build-angular:application",
"options": {
...
...
"assets": [
{
"glob": "**/*",
"input": "public"
},
{
"input": "node_modules/@electric-sql/pglite/dist",
"glob": "postgres.(data|wasm)"
}
],
"styles": ["src/styles.scss"],
"scripts": [],
"externalDependencies": ["util"]
},
}