Skip to content

fix(transformers): errors.map is not a function#7672

Merged
devongovett merged 2 commits into
parcel-bundler:v2from
sweetliquid:transformers/html
Mar 20, 2022
Merged

fix(transformers): errors.map is not a function#7672
devongovett merged 2 commits into
parcel-bundler:v2from
sweetliquid:transformers/html

Conversation

@sweetliquid

Copy link
Copy Markdown
Contributor

↪️ Pull Request

💻 Examples

🚨 Test instructions

✔️ 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

@height

height Bot commented Feb 8, 2022

Copy link
Copy Markdown

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

@Shinyaigeek

Copy link
Copy Markdown
Contributor

https://github.com/parcel-bundler/parcel/blob/v2/packages/transformers/html/src/dependencies.js#L117

The errors collectDependencies throw seems to be only array, so errors.map should be a valid function. Is there some case that parcel throws “errors.map is not a function” error in HTMLTransformer? ( if there is, please share reproduction)

@sweetliquid

sweetliquid commented Feb 8, 2022

Copy link
Copy Markdown
Contributor Author

The error is thrown by other functions called by collectDependencies like QUERIES[i].select in browserslist package

throw new BrowserslistError(
  'Unknown version ' + version + ' of ' + name
)

@sweetliquid

sweetliquid commented Feb 8, 2022

Copy link
Copy Markdown
Contributor Author

I think errors those are not directly thrown by collectDependencies can be ignored(re-thown).

@sweetliquid

Copy link
Copy Markdown
Contributor Author

If I create the .browserslistrc file with any wrong content like: xxx, it thrown emit error: TypeError: errors.map is not a function when I run parcel build

@Shinyaigeek

Copy link
Copy Markdown
Contributor

Oh I see, I cannot reproduce it but I feel this can happen and this change is reasonable. Thank you !

@devongovett devongovett merged commit c9a4238 into parcel-bundler:v2 Mar 20, 2022
gorakong pushed a commit that referenced this pull request Nov 3, 2022
* upstream/v2:
  Upgrade Flow to 0.174.1 (#7849)
  v2.4.0
  v2.4.0 changelog
  Bump Parcel CSS
  Dynamic imports priority fix closes #6980 (#7061)
  fix(transformers): errors.map is not a function (#7672)
  Make NodeResolver check realpath before resolving with `source` entry (#7846)
  docs: fix wrong location documents (#7689)
  Fix: escape double quote of url value in CSS `url()` (#7718)
  Update @parcel/css and add diagnostic for url dependencies in custom properties (#7845)
  Use relative path for bundle labels in bundle analysis (#7737)
  Allow use react-jsx transform in React 16.14.0 (#7728)
  Move to @parcel/css by default (#7821)
  Feature: pick PORT number also from .env file (#7819)
  Enable parsing static initialization blocks (#7839)
  Bump swc and prevent pure comment removal (#7833)
  Bump swc (#7777)
  Human readable file size in bundle analyzer report (#7766)
  Improve emoji support detection (#7775)
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.

3 participants