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

unable to import @joplin/turndown into my esm project #10640

Open
vassudanagunta opened this issue Jun 20, 2024 · 1 comment
Open

unable to import @joplin/turndown into my esm project #10640

vassudanagunta opened this issue Jun 20, 2024 · 1 comment
Labels
bug It's a bug

Comments

@vassudanagunta
Copy link
Contributor

Operating system

macOS

Joplin version

latest

Desktop version info

No response

Current behaviour

import TurndownService from '@joplin/turndown'

results in

error TS7016: Could not find a declaration file for module '@joplin/turndown'. '.../node_modules/@joplin/turndown/lib/turndown.cjs.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/joplin__turndown` if it exists or add a new declaration (.d.ts) file containing `declare module '@joplin/turndown';`

The same thing happens for @joplin/turndown-plugin-gfm.

Expected behaviour

Looking in the node_modules/@joplin/turndown, I only see turndown.cjs.js, not the .es.mjs version that the package.json build script mentions.

I was hoping to use your version of Turndown.js!

Logs

No response

@vassudanagunta vassudanagunta added the bug It's a bug label Jun 20, 2024
@personalizedrefrigerator
Copy link
Collaborator

Based on packages/turndown/package.json, it seems that only the CJS version of the library is built in CI:

"build": "rollup -c config/rollup.config.cjs.mjs",

"prepare": "npm run build"

The prepare step might need to be changed to npm run build-all to support ESM.

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

No branches or pull requests

2 participants