Closed wartab closed 3 years ago
Indeed this is expected not to work. Webpack specific features are not supported by the Angular CLI.
CSV files should be loaded using XHR requests. See: https://angular.io/guide/http
We use raw-loader to inline svg icons and get the same error.
So there is no way to statically inline anything any more? Or is the webpack asset/source module type supported as #21305 seems to suggest? And if that is the case, how to enable it for additional file patterns?
The CSVs were just one example. But the a few of our cases don't really have access to HttpClient and/or can't be loaded asynchronously.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
π Bug report
Command (mark with an
x
)Is this a regression?
Yes, the previous version in which this bug was not present was: .... Yes, this still worked in 12.1. Not sure if it was an intended feature, but it's been working for years. ### Description A clear and concise description of the problem... ## π¬ Minimal Reproduction ```ts const csv = require("raw-loader!../../locale/translations.editor.csv").default; ``` Code such as the one above breaks upon trying to build the Angular application using `ng build` or `ng serve` after the update.π₯ Exception or Error
π Your Environment
Anything else relevant? Seems to be related to: https://github.com/angular/angular-cli/pull/21305
Also if our broken code should never have worked in the first place, can you please indicate how to load local files from the project statically?