Skip to content

Support decodeURIComponent in import urlΒ #55220

Closed

Description

Suggestion

πŸ” Search Terms

βœ… Viability Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.

⭐ Suggestion

Currently, ts treat import url as path, not url (remove search / hash and decodeURIComponent firstly).

Is it possible to support decodeURIComponent for import url, at least for "moduleResolution": "NodeNext" / "bundler", or url in format with scheme like http://example.com/%3F.js?version or file:./path%25, because that's the standard behaviour of Node.js / browser?

πŸ“ƒ Motivating Example

import './path%25.mjs';// actually expect './path%.mjs', not './path%25.mjs'

πŸ’» Use Cases

import filename including \ % ? #.

Activity

  1. andrewbranch commented on Jul 31, 2023

    @andrewbranch
    Member

    Duplicate of #41730

  2. added
    DuplicateAn existing issue was already created
    and removed
    Needs InvestigationThis issue needs a team member to investigate its status.
    on Jul 31, 2023
  3. locked as resolved and limited conversation to collaborators on Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions