handlebars templates highlighting doesn't work
See original GitHub issue`
import $ from 'jquery';
import Prism from 'prismjs/components/prism-core';
import 'prismjs/components/prism-markup';
import 'prismjs/components/prism-markup-templating';
import 'prismjs/components/prism-handlebars';
import loadLanguages from 'prismjs/components/index.js';
export class StyleHighlighter {
constructor(){
loadLanguages(['handlebars']);
Prism.highlightAll();
}
}
new StyleHighlighter();
`
The error is showing:
Uncaught Error: Cannot find module './prism-markup'
Do you have a working version of latest handlbars template highlighting?
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
How to enable syntax highlighting for *.handlebars files within ...
I know there is an extension which allows highlighting of handlebars templates within *.html files, however I require the naming convention of * ......
Read more >Handlebars syntax highlighting does not take affect
Configuring the file extensions for Handlebars syntax highlighting does not take affect and the text does not receive any highlighting. Steps to ...
Read more >WebStorm doesn't recognize and highlight inline Handlebars ...
I am working on a project that uses Ember.js. Our component integration tests use the hbs method from ember-cli-htmlbars to create tagged template...
Read more >r/neovim - Proper Syntax highlighting for Javascript in HTML ...
I am working on a Vue app that is being injected via Handlebars. ... Syntax highlighting for Javascript in HTML template files via...
Read more >Building your first Support app - Part 3: Creating and inserting ...
Open your iframe.html file and add the following <script> tag before all the other ... The template contains several Handlebars highlighted expressions.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is probably a result of how your webpack is configured. If the css loaders only include css files within the project (e.g. Ignoring node_modules), it’ll ignore css dependencies and throw this error.
I found a solution for stubbing CSS files: https://stackoverflow.com/a/41851815/6141025
You can use
moduleNameMapper
to map*.css
to the stub:./jest.config.js
./mocks/styleMock.js
I was getting an error related to this issue and Prismjs: