10000 highlight.js not detected! · Issue #78 · wcoder/highlightjs-line-numbers.js · GitHub
[go: up one dir, main page]

Skip to content
highlight.js not detected! #78
Closed
Closed
@miadabdi

Description

@miadabdi

Describe the bug
I'm trying to use this package. even though I import it after highlight.js, it keeps throwing highlight.js not detected!

To Reproduce
Steps to reproduce the behavior:
First of all I'm using Webpack with this config:

const path = require("path");

module.exports = {
    devtool: "source-map",
    entry: path.join(__dirname, "js/index.js"),
    output: {
        filename: "bundle.js",
        path: path.join(__dirname, "../public/js"),
    },
    watch: true,
    mode: "development",
};

I installed highlight.js and highlightjs-line-numbers.js using npm.
I imported them this way (using es6 import/export):

import hljs from "highlight.js";
import "highlightjs-line-numbers.js";
hljs.initHighlightingOnLoad();
hljs.initLineNumbersOnLoad();

and it throws:
Screenshot from 2020-10-04 17-38-37

I also tried to import highlight.js this way. still throws the same error

import "highlight.js";

Expected behavior
To detect highlight.js

Desktop (please complete the following information):

  • OS: Ubuntu 20.04
  • Browser firefox
  • Version 76.0.1 (64-bit)

webpack version: 4.44.1
highlight.js version: 10.2.1
highlightjs-line-numbers.js version: 2.8.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0