i18next / i18next-parser

Parse your code to extract translation keys/values and manage your catalog files
MIT License
486 stars 198 forks source link

Fix Cheerio dependency semver #1045

Closed JavaScriptBach closed 3 months ago

JavaScriptBach commented 3 months ago

💥 Regression Report

This package specifies a dependency on Cheerio ^1.0.0-rc.2. This allows 1.0.0 to be installed. However, Cheerio just released 1.0.0 and it has breaking changes compared with previous release candidates: https://github.com/cheeriojs/cheerio/releases

The relevant change in this case is

The deprecated default Cheerio instance and static methods were removed.

This is now breaks npm installs depending on what version of cheerio the lockfile resolves to.

file:<omitted>/node_modules/i18next-parser/dist/lexers/html-lexer.js:2
import cheerio from 'cheerio';var
       ^^^^^^^
SyntaxError: The requested module 'cheerio' does not provide an export named 'default'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:134:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:217:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:323:24)
    at async loadESM (node:internal/process/esm_loader:28:7)
    at async handleMainPromise (node:internal/modules/run_main:113:12)

Suggested Fix

Either pin cheerio to a version before 1.0.0, or update to 1.0.0 and fix the imports.

JavaScriptBach commented 3 months ago

Thanks, I see you've fixed this in https://github.com/i18next/i18next-parser/commit/6a48bd460ede9f01decbf9f2e3bbaa70ee781d83

karellm commented 3 months ago

Yes, I forgot to close this. It is in 9.0.2