Open JohnnyDevNull opened 7 months ago
As additional info... it seems just a problem with the Vite Dev Server because when I build and serve the app it works:
https://github.com/JohnnyDevNull/angular17-esbuild-browserify-error
ng build --source-map
npx serve dist/ng-dummy/browser
This is a little bit confusing, because I would assume that the dev server works not that seriously different from building the app?
Are there any news about this topic? We cannot move forward to esbuild because of this Bug.
@Alex-2801, can you try to run ng serve
with prebundle set to false
and check if it works?
The server command is inconsistent with the build command and disabling prebundling might help.
@Carlosamouco thanks a lot. Adding --prebundle=false
worked 👍
Edit: Of course its also possible to add it in the project.json
Command
serve
Is this a regression?
The previous version in which this bug was not present was
none
Description
We're currently in the evaluation of replacing the Webpack with ESBuild process from Angular.
The only blocker right now is, that the path replacements for the building process does not work as expected and the application directly crashes into a white screen.
Minimal Reproduction
https://github.com/JohnnyDevNull/angular17-esbuild-browserify-error
npm install
ng serve
Open the app and you will directly see an Vite warning and the error from the 3rd party library we are using
fhir
in this case for the healthcare sector.As you can see in the configs below I've added the
paths
andbrowser
properties to help esbuild understand the mapping, but it does not work anyways.Just to mention, the 3rd party library is a CommonJS library, which we cannot avoid here, so its added to the
allowedCommonJsDependencies
configuration.tsconfig.json
package.json
Exception or Error
Your Environment
Anything else relevant?
This issue was already reported with https://github.com/angular/angular-cli/issues/26901 but sadly to say closed. I hope you have now a better picture with my simple reproduction repo.