Jinja2/htmlmixed Mode

I am attempting to create a mode that will allow HTML highlighting with embedded Jinja2 tags. I am not sure what I have done wrong but I am now getting the error “CodeMirror.multiplexingMode is not a function”
My code is as follows:

CodeMirror.defineMode('jinja2-html', function (config) {
	return CodeMirror.multiplexingMode(
		CodeMirror.getMode(config, 'htmlmixed'),
		{
			open: '{%',
			close: '%}',
			mode: CodeMirror.getMode(config, 'jinja2'),
			delimStyle: 'delimit' 
		},
		{
			open: '{{',
			close: '}}',
			mode: CodeMirror.getMode(config, 'jinja2'),
			delimStyle: 'delimit' 
		},
		{
			open: '{#',
			close: '#}',
			mode: CodeMirror.getMode(config, 'jinja2'),
			delimStyle: 'delimit' 
		}
			
	)
})

To be fair I have 0 idea what I am doing as I just picked this up today but this is the best attempt I could make given the resources I could find. If anyone has any insight I would be happy to hear it.
I am importing both of the base modes as well as the base lib before calling this code.