Shopify / Shopify/tapioca

Warning: already initialized constant `URI::Schemes::SOURCE`

Open
#2,471 1 comment 0 reactions 1 assignee View on GitHub

@amomchilov is already working on this.

Since Jan 5, 2026.

bug
Dominant language
Ruby
Stars
873
Forks
164
Avg merge
4d 27m
Merged PRs (30d)
9

Description

/home/runner/work/tapioca/tapioca/vendor/bundle/ruby/3.4.0/gems/uri-1.1.1/lib/uri/common.rb:123: warning: already initialized constant URI::Schemes::SOURCE
/home/runner/work/tapioca/tapioca/vendor/bundle/ruby/3.4.0/gems/uri-1.1.1/lib/uri/common.rb:123: warning: previous definition of SOURCE was here

CI build log

I made this commit to debug where this is coming from, and found these conflicting definitions when you run bin/test:

  1. https://github.com/Shopify/tapioca/blob/2fcb44b50e6fad7b82adb80a345a703ea836a942/lib/tapioca/helpers/source_uri.rb#L78-L82

  2. https://github.com/Shopify/ruby-lsp/blob/e0b26e129dcb58cbbfc31c1a6b56e57bf42ac5d6/lib/ruby_lsp/requests/support/source_uri.rb#L73-L78

We can easily detect this with condition with URI.scheme_list.has_key?("SOURCE"), but that doesn't solve the discrepancy of trying to set two different classes for the same URI. They're really similar, but still distinct.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.