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

BREAKING CHANGE: v3.5.0 incompatible with CJS projects #58

Open
dabrady opened this issue Oct 22, 2024 · 1 comment
Open

BREAKING CHANGE: v3.5.0 incompatible with CJS projects #58

dabrady opened this issue Oct 22, 2024 · 1 comment

Comments

@dabrady
Copy link

dabrady commented Oct 22, 2024

Aloha @dichovsky,

I have an ES6 project that uses this package. All was well through v3.3.0, but v3.5.0 changed the TypeScript compilation target to a much more recent version of JavaScript: from ES6 to ES2022. This prevents it from being used in projects that compile down to CommonJS.

Before After
image image

This break manifests like so during compilation of a consuming project(in my case, anyways):

./node_modules/pdf-to-png-converter/out/index.js:1
export { pdfToPng } from './pdf.to.png';
^^^^^^

SyntaxError: Unexpected token 'export'
    at internalCompileFunction (node:internal/vm:73:18)
    at wrapSafe (node:internal/modules/cjs/loader:1176:20)
    at Module._compile (node:internal/modules/cjs/loader:1218:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12)
    at Module.require (node:internal/modules/cjs/loader:1141:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at Object.<anonymous> (.../src/helpers/pdf-to-images.js:4:32)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)

I'm not asking you to do anything specific here -- I can resolve my problem by pinning my dependency on your project to v3.3.0 and never upgrading. I just wanted to report this in case it was an unintentional move (and I think it was, since this was introduced in a minor version bump instead of a major one.)

Anywho, mahalo for contributing this package! Take care. 🌺

@dichovsky
Copy link
Owner

Thanks for reporting. v3 will remain on ES6. Please checkout v3.5.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants