You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Started work on this and found an issue where highlightjs-line-numbers.js doesn't work with Vite's ES6 modules. This is due to it being restricted to CommonJS (wcoder/highlightjs-line-numbers.js#78).
A potential workaround is using a CDN like Cloudflare and loading it after app.js where the plugin can access hljs on the window like it's designed. Or switching to another open-source free code highlighter like Prism.
Found a third option I found is to create an intermediate JavaScript file in resources/js that imports highlightjs-line-numbers.js that gets resolved after app.js in its own <script> tag. This has the same effect as using the CDN it's just it uses the npm version instead.
Similar to laravelio/laravel.io#882
The text was updated successfully, but these errors were encountered: