Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main branch exhibits breaking changes when markdown-it-highlightjs is upgraded to it from 11.5.1 #4026

Open
aral opened this issue Mar 25, 2024 · 1 comment
Labels
bug help welcome Could use help from community parser

Comments

@aral
Copy link
Contributor

aral commented Mar 25, 2024

Describe the issue/behavior that seems buggy

It looks like something changed in main that’s breaking the markdown-it-highlightjs plugin when upgraded to it from the version it is currently using (11.5.1)

Specifically, tests pass before the upgrade but when running the tests after an upgrade, I’m seeing:

Error: Cannot find module '/var/home/aral/Projects/other/markdown-it-highlightjs/node_modules/highlight.js/lib/index.js'. Please verify that the package.json has a valid "main" entry

(Full stack trace at end.)

Sample Code or Instructions to Reproduce

  1. git clone https://github.com/valeriangalliat/markdown-it-highlightjs.git
  2. cd markdown-it-highlightjs.git
  3. npm i
  4. npm run test and note all tests passing
  5. Change the highlight.js dependency in package.json from 11.5.1 to https://github.com/highlightjs/highlight.js
  6. npm i
  7. npm run test

Expected behavior

Since 11.5.1 →11.9.0 (version in main) is a semver minor update, I’d expect all tests to still pass.

The issue does not exist in the release version of 11.9.0, where all tests pass, so this is either a regression or a breaking change in main.

Actual behavior

Tests fail with error message mentioned above and with full stack trace as provided below.

Additional context

Full stack trace:

Error: Cannot find module '/var/home/aral/Projects/other/markdown-it-highlightjs/node_modules/highlight.js/lib/index.js'. Please verify that the package.json has a valid "main" entry
    at tryPackage (node:internal/modules/cjs/loader:450:19)
    at Module._findPath (node:internal/modules/cjs/loader:720:18)
    at Module._resolveFilename (node:internal/modules/cjs/loader:1135:27)
    at Module._load (node:internal/modules/cjs/loader:990:27)
    at Module.require (node:internal/modules/cjs/loader:1237:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (/var/home/aral/Projects/other/markdown-it-highlightjs/dist/index.js:40:32)
    at Module._compile (node:internal/modules/cjs/loader:1378:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1437:10)
    at Module.load (node:internal/modules/cjs/loader:1212:32)
    at Module._load (node:internal/modules/cjs/loader:1028:12)
    at Module.require (node:internal/modules/cjs/loader:1237:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (/var/home/aral/Projects/other/markdown-it-highlightjs/index.js:1:18)
    at Module._compile (node:internal/modules/cjs/loader:1378:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1437:10)
    at Module.load (node:internal/modules/cjs/loader:1212:32)
    at Module._load (node:internal/modules/cjs/loader:1028:12)
    at Module.require (node:internal/modules/cjs/loader:1237:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (/var/home/aral/Projects/other/markdown-it-highlightjs/test/test.js:6:21)
    at Module._compile (node:internal/modules/cjs/loader:1378:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1437:10)
    at Module.load (node:internal/modules/cjs/loader:1212:32)
    at Module._load (node:internal/modules/cjs/loader:1028:12)
    at cjsLoader (node:internal/modules/esm/translators:359:17)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:308:7)
    at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:323:24)
    at async importModuleDynamicallyWrapper (node:internal/vm/module:430:15)
    at async formattedImport (/var/home/aral/Projects/other/markdown-it-highlightjs/node_modules/mocha/lib/nodejs/esm-utils.js:7:14)
    at async exports.requireOrImport (/var/home/aral/Projects/other/markdown-it-highlightjs/node_modules/mocha/lib/nodejs/esm-utils.js:48:32)
    at async exports.loadFilesAsync (/var/home/aral/Projects/other/markdown-it-highlightjs/node_modules/mocha/lib/nodejs/esm-utils.js:103:20)
    at async singleRun (/var/home/aral/Projects/other/markdown-it-highlightjs/node_modules/mocha/lib/cli/run-helpers.js:125:3)
    at async exports.handler (/var/home/aral/Projects/other/markdown-it-highlightjs/node_modules/mocha/lib/cli/run.js:374:5)
@aral aral added bug help welcome Could use help from community parser labels Mar 25, 2024
@aral aral changed the title Main branch has issues with markdown-it-highlightjs Main branch has breaking changes when markdown-it-highlightjs is upgraded to it from 11.5.1 Mar 25, 2024
@aral aral changed the title Main branch has breaking changes when markdown-it-highlightjs is upgraded to it from 11.5.1 Main branch exhibits breaking changes when markdown-it-highlightjs is upgraded to it from 11.5.1 Mar 25, 2024
@joshgoebel
Copy link
Member

❯ ls build/lib/index.js
build/lib/index.js
❯ cat build/package.json| grep main
  "main": "./lib/index.js",

We stil ship this file... if someone else has any more specific details on this failure...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help welcome Could use help from community parser
Projects
None yet
Development

No branches or pull requests

2 participants