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

Package unavailable at jspm #12

Open
bjhess opened this issue Dec 10, 2024 · 1 comment
Open

Package unavailable at jspm #12

bjhess opened this issue Dec 10, 2024 · 1 comment

Comments

@bjhess
Copy link

bjhess commented Dec 10, 2024

I wanted to share this in case it relates to any real issues with the library. Feel free to close it with "not our problem" though!

I am using Tiptap via Rhino and Rails. Specifically I am loading libraries with Import Maps. I couldn't pin this extension in my usual way:

> bin/importmap pin "@aarkue/tiptap-math-extension"                
Couldn't find any packages in ["@aarkue/tiptap-math-extension"] on jspm

Nor did jsdelivr work

> bin/importmap pin "@aarkue/tiptap-math-extension" --from jsdelivr
Couldn't find any packages in ["@aarkue/tiptap-math-extension"] on jsdelivr

unpkg did work:

> bin/importmap pin "@aarkue/tiptap-math-extension" --from unpkg   
Pinning "@aarkue/tiptap-math-extension" to https://unpkg.com/@aarkue/[email protected]/dist/index.js

Leading to this in my importmap.rb file:

pin "@aarkue/tiptap-math-extension", to: "https://unpkg.com/@aarkue/[email protected]/dist/index.js"
pin "evaluatex/dist/evaluatex", to: "https://unpkg.com/[email protected]/dist/evaluatex"
pin "katex", to: "https://unpkg.com/[email protected]/dist/katex.mjs"

I visited https://generator.jspm.io to see if I could cobble together a jspm entry manually. I searched for "@aarkue/tiptap-math-extension" and here's what I saw:
CleanShot 2024-12-10 at 10 19 04@2x

Error: No './dist/evaluatex' exports subpath defined in https://ga.jspm.io/npm:[email protected]/ resolving evaluatex/dist/evaluatex imported from https://ga.jspm.io/npm:@aarkue/[email protected]/dist/index.js.

In case it's helpful, this seems a bit similar to my challenges importing MathExtension when loading up Rhino/Tiptap. Snippet from my rhino_controller.js file:

import MathExtension from "@aarkue/tiptap-math-extension"
...
rhino.addExtensions([MathExtension])

In the browser:

Failed to register controller: rhino (controllers/rhino_controller) SyntaxError: The requested module 'evaluatex/dist/evaluatex' does not provide an export named 'default'
@aarkue
Copy link
Owner

aarkue commented Dec 20, 2024

Thanks for reporting this!
I am not familiar with jspm, but I will try to look into it when I find the time.

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