I used to be able to use Handlebars in Angular 11 but since I updated to Angular 12 I'm getting the following errors:
./node_modules/handlebars/lib/index.js:25:2-9 - Warning: Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
./node_modules/handlebars/lib/index.js:23:38-45 - Error: Module not found: Error: Can't resolve '.' in '/node_modules/handlebars/lib'
I'm importing Handlebars like
import * as handlebars from 'handlebars';
I have tried to add Handlebars to the angular.json
as following but nothing seems to be working.
"node_modules/handlebars/dist/handlebars.min.js"
handlebars
as a dependency in the project: stackblitz.com/edit/angular-ivy-kvbih4 – Leporine