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

Sanitize target name before resolving #9905

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from

Conversation

sephialaureenciaa
Copy link

↪️ Pull Request

Closes #9001

Before this PR, parcel will throw an error when target name contains slash. To fix this, we wrap targetName with encodeJSONKeyComponent so that the slash gets encoded properly.

💻 Examples

    "/dist/server_commonjs": {
      "isLibrary": true,
      "source": "src/index.ts",
      "optimize": false,
      "context": "node",
      "outputFormat": "commonjs",
      "distDir": "dist/server/commonjs"
    }

Previously, this error would pop up:
Error: Cannot use 'in' operator to search for 'key' in undefined

✔️ PR Todo

  • Added/updated unit tests for this change
  • Filled out test instructions (In case there aren't any unit tests)
  • Included links to related issues/PRs

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

Successfully merging this pull request may close these issues.

If a target name contains a slash, parcel fails with a hard-to-diagnose error message
1 participant