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

pinning not picking up dependency correctly #264

Open
holman opened this issue Sep 24, 2024 · 2 comments
Open

pinning not picking up dependency correctly #264

holman opened this issue Sep 24, 2024 · 2 comments

Comments

@holman
Copy link

holman commented Sep 24, 2024

Running into a weird issue with a specific pin:

bin/importmap pin @diffusionstudio/core

This has a few dependencies that get detailed in my importmap correctly, but I think there's primarily a problem with pixi.js, the larger of the dependencies: I end up getting a lot of errors in-browser:

[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (BUSvQCAZ.js, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (DIHtiX9t.js, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (CXKUhZnG.js, line 0)
--snip--

The odd-named files stem from how pixi.js is handling its files- there's a lot of strings that get spit out for filenames. Accordingly, not able to load @diffusionstudio/core through it.

Using the JSPM generator seems to work in that I can access the original diffusionstudio/core library through import maps, but it's not working in Railsland for some reason- any thoughts? (Apologies in advance if I'm holding it wrong; it's tricky to dig into third party dependencies sometimes!)

@jameswilliamiii
Copy link

I am having the same issue with rbui-js where dependencies @popperjs/core, date-fns, and chart.js throw the same 404 errors.
image

@tagliala
Copy link

tagliala commented Oct 9, 2024

Got a similar same issue with mermaid

I guess it is the trailing slash in dagre-d3-es/src/, but I don't know if this should be fixed here or in a nested package

$ bin/importmap pin mermaid
Pinning "mermaid" to vendor/javascript/mermaid.js via download from https://ga.jspm.io/npm:mermaid@11.2.1/dist/mermaid.core.mjs

... omissis ...

Pinning "d3-zoom" to vendor/javascript/d3-zoom.js via download from https://ga.jspm.io/npm:d3-zoom@3.0.0/src/index.js
Pinning "dagre-d3-es/src/" to vendor/javascript/dagre-d3-es/src/.js via download from https://ga.jspm.io/npm:dagre-d3-es@7.0.10/src/
~/.rvm/gems/ruby-3.3.5/gems/importmap-rails-2.0.2/lib/importmap/packager.rb:84:in `handle_failure_response': Unexpected response code (404) (Importmap::Packager::HTTPError)
	from ~/.rvm/gems/ruby-3.3.5/gems/importmap-rails-2.0.2/lib/importmap/packager.rb:122:in `download_package_file'
	from ~/.rvm/gems/ruby-3.3.5/gems/importmap-rails-2.0.2/lib/importmap/packager.rb:57:in `download'
	from ~/.rvm/gems/ruby-3.3.5/gems/importmap-rails-2.0.2/lib/importmap/commands.rb:19:in `block in pin'
	from ~/.rvm/gems/ruby-3.3.5/gems/importmap-rails-2.0.2/lib/importmap/commands.rb:17:in `each'
	from ~/.rvm/gems/ruby-3.3.5/gems/importmap-rails-2.0.2/lib/importmap/commands.rb:17:in `pin'
	from ~/.rvm/gems/ruby-3.3.5/gems/thor-1.3.2/lib/thor/command.rb:28:in `run'
	from ~/.rvm/gems/ruby-3.3.5/gems/thor-1.3.2/lib/thor/invocation.rb:127:in `invoke_command'
	from ~/.rvm/gems/ruby-3.3.5/gems/thor-1.3.2/lib/thor.rb:538:in `dispatch'
	from ~/.rvm/gems/ruby-3.3.5/gems/thor-1.3.2/lib/thor/base.rb:584:in `start'
	from ~/.rvm/gems/ruby-3.3.5/gems/importmap-rails-2.0.2/lib/importmap/commands.rb:141:in `<main>'
	from ~/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require'
	from ~/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require'
	from ~/.rvm/gems/ruby-3.3.5/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
	from ~/.rvm/gems/ruby-3.3.5/gems/zeitwerk-2.6.18/lib/zeitwerk/kernel.rb:34:in `require'
	from bin/importmap:4:in `<main>'

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

3 participants