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

Prevent unhandled rejection with buildCodeFrameMessage #567

Conversation

raejin
Copy link
Contributor

@raejin raejin commented Jun 9, 2020

We encounter regular resolution issue but was not captured by throwing
proper resolution error, this handles the specific case we're seeing.

(node:309) UnhandledPromiseRejectionWarning: Error: EISDIR: illegal operation on a directory, read
    at Object.readSync (fs.js:498:3)
    at tryReadSync (fs.js:332:20)
    at Object.readFileSync (fs.js:369:19)
    at UnableToResolveError.buildCodeFrameMessage 

Ever since upgraded, we've seen the above error messages representing in fact an actual resolution error that should have been represented by Unable to resolve module %s from %s: %s messages.

Test plan

  • CI

proper resolution error, this handles the specific case we're seeing.
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 9, 2020
Copy link
Contributor

@cpojer cpojer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you 👍

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cpojer has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cpojer has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@cpojer merged this pull request in 1e6cec8.

hypest added a commit to wordpress-mobile/gutenberg-mobile that referenced this pull request Jun 17, 2021
Issue message: "Error: EISDIR: illegal operation on a directory, read"
Fix PR on Metro: facebook/metro#567
hypest added a commit to WordPress/gutenberg that referenced this pull request Jun 17, 2021
Issue message: "Error: EISDIR: illegal operation on a directory,
read"
Fix PR on Metro: facebook/metro#567
hypest added a commit to WordPress/gutenberg that referenced this pull request Jun 17, 2021
* Upgrade to latest react-native-modal

To fix "Animated.event now requires a second argument for options"
caused by using a fairly old version of the lib.

* Additional `npm install` managed to bump more instances

* Revert "Additional `npm install` managed to bump more instances"

This reverts commit 1e05044.

* Manually bump the react-native-modal entry in package-lock.json

* onSwipe is deprecated, use onSwipeComplete

As per
https://github.com/react-native-modal/react-native-modal/blob/b580105f4b2b4e1163bed1228f241b16ea17dacb/src/modal.tsx#L268-L272

* fetch() is deprecated for isScreenReaderEnabled

See
https://github.com/facebook/react-native/blob/v0.64.0/Libraries/Components/AccessibilityInfo/AccessibilityInfo.android.js#L94-L99

* Toolbar needs label set

As per the doc
https://github.com/WordPress/gutenberg/blob/7fc4197a6494c040fc3d4e491f22602e058fb126/packages/components/src/toolbar/index.js#L30-L35

* componentWillUnmount is deprecated, use componentDidMount

Which is also the recommended way to add subscriptions. See
https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#adding-event-listeners-or-subscriptions

* Podfile.lock updated after `npm run core ios`

* Revert "Toolbar needs label set"

This reverts commit d6cf2f8.

* Use ToolbarGroup in native mobile instead of label-less Toolbar

Label-less Toolbar is deprecated
https://github.com/WordPress/gutenberg/blob/7fc4197a6494c040fc3d4e491f22602e058fb126/packages/components/src/toolbar/index.js#L30-L35

Tried to add labels with d6cf2f8 but introduced issues: the keyboard
dismiss button was out of place.

* Revert "Podfile.lock updated after `npm run core ios`"

This reverts commit ce1baea.

* Temporary Metro patch until RN upgrades Metro

Issue message: "Error: EISDIR: illegal operation on a directory,
read"
Fix PR on Metro: facebook/metro#567

* Animated.event needs is second param always set
geriux added a commit to wordpress-mobile/gutenberg-mobile that referenced this pull request Jun 25, 2021
* Update gutenberg reference

* Update package-lock

* Update gutenberg ref

* Updated gutenberg ref

* Updating gutenberg ref

* Updated hermes executable to hermesc for building bundle

* Updated bundle

* Update gutenberg ref

* Add changes to package-lock.json after running npm install

* Disabled npm cache on CI

* Update gutenberg ref

* Add @react-native to transformIgnorePatterns in jest config

Expecting this to fix the following error:
```
/home/circleci/project/gutenberg/node_modules/@react-native/polyfills/error-guard.js:14
type ErrorHandler = (error: mixed, isFatal: boolean) => void;
        ^^^^^^^^^^^^

SyntaxError: Unexpected identifier

    at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/node_modules/@jest/transform/build/ScriptTransformer.js:537:17)
    at Object.<anonymous> (gutenberg/node_modules/react-native/jest/setup.js:434:6)
```

* Update gutenberg ref

* Update gutenberg ref

* updated gutenberg ref

* Upgrade react-native related devDependencies

* Update gutenberg ref

* Fix check correctness diff error

* Update gutenberg ref

* Update gutenberg ref

* Updated bundle files

* Updated gutenberg ref

* Updated gutenberg ref

* Updated gutenberg ref

* Adding cache-version file for re-running circle-ci

* Update gutenberg ref

* Updated gutenberg ref

* Updated ref, removed react-native-mirror s3 from bridge gradle

* updated bundle

* Update podspecs by running generate-podspecs.sh script

* Updating gutenberg ref

* Update bundle

* Update gutenberg ref

* Revert "Disabled npm cache on CI"

This reverts commit 3958c64.

* Modify generate-podspecs.sh script to run FBReactNativeSpec codegen ahead of time

* Update gutenberg ref

* Update package-lock.json

* Update package-lock.json

* Add workaround for FBReactNativeSpec podspec in generate-poscpecs.sh script

* Update commit hash of FBReactNativeSpec

* Fix typo

* Update commit hash of FBReactNativeSpec

* Add missing external podspecs to generate-podspecs.sh script

* Re-generate third-party-podspecs, remove react-native-linear-gradient podspec

* Update commit hash of FBReactNativeSpec

* Add exception for react-native-slider fork

* Remove tag from react-native-slider podspec

* Fix react-native-slider git source

* Update gutenberg ref

* Update bundles

* Update gutenberg reference

* Update release notes with fix for Gboard enter detection

* Update gutenberg ref

* Update jetpack ref

* Update bundles

* Update gutenberg ref

* Update gutenberg ref

* Re-run generate-podspecs.sh to update BVLinearGradient podspec

* Update gutenberg ref

* Update bundles

* Shallow clone project for CI tasks

Decrease CI task duration by reducing depth of git operations.

- [CircleCI: Shallow Repository Cloning](https://support.circleci.com/hc/en-us/articles/360045096514-Shallow-Repository-Cloning)
- [CircleCI: How do I modify the checkout step?](https://support.circleci.com/hc/en-us/articles/115015659247-How-do-I-modify-the-checkout-step-)
- [Example: CircleCI Shallow Clone](https://discuss.circleci.com/t/shallow-clone-for-circleci-2-0-builds/20200)

* Update Gutenberg ref

* Updates gutenberg reference

* Update Gutenberg submodule ref

Fix component inspector error in React Native

* Bump Gutenberg to latest trunk

* Update gutenberg ref

* Changes to package-lock.json after running npm install

* Update bundles

* Run ./bin/generate-podspecs.sh

* Update gutenberg ref to merge commit

* Update Gutenberg ref

* Add a few improvements and checks to generate-podspecs.sh

* Add a warning field at the bottom of all podspecs

* Add a warning when the tag or commit field is missing in a podspec

* Patch react-native-blur.podspec adding the missing tag

* Better wording

* Update bundles

* Update FBReactNativeSpec ref

* Indent patch messages

* Patch react-native-blur.podspec again as 3.6.0 tag is missing

* CI fetches commit reference directly

The CI configuration is set to clone with a depth of 1. If the CI tasks
then attempts to reference an older commit in the relevant branch, an
error occurs. This might occur when a branch merge occurs between a CI
tasks beginning and the point it attempt to fetch the HEAD of the
branch. This change configures the shallow clone to fetch the specific
commit reference, rather than the HEAD of the relevant branch.

* Update gutenberg reference

* Update gutenberg ref

* Update gutenberg ref

* Update gutenberg ref

* Update gutenberg ref

* Update bundles

* Generate build

* Moved item to the unreleased section of release notes

* Update Gutenberg ref with merge commit

* Bump Gutenberg hash

* Update Gutenberg hash

* Bump Gutenberg hash

* Update Gutenberg hash

* Update Gutenberg hash

* Temporary Metro patch until RN upgrades Metro

Issue message: "Error: EISDIR: illegal operation on a directory, read"
Fix PR on Metro: facebook/metro#567

* Bump Gutenberg hash

* Bump Gutenberg to the merged hash

* Update Gutenberg ref

* Update release notes

* Fix incorrect block insertion point after blurring post title

Selecting the title selection status within the same `useSelect` for
reusable blocks caused the title selection status to become stale, due
to the dependency array for the `useSelect` hook.

The staleness caused the block insertion point to show up in the
incorrect location after blurring the title text input.

* Update gutenberg ref

* Bump Gutenberg

* Update RELEASE-NOTES.txt

* Update Gutenberg hash which contains fix to Android artifact publishing

* Bump Gutenberg

* Add: Grid block, from block-experiments repo

* Bump block-expeiments

* Update the no_output_timeout to 15min

* Revert the longer timeout.

* Add block-experiments to eslintignore

* Remove comment.

* Fix prettier

* Bump block-experiements

* All Layout Grid controls

* Bump block experiment fixes

* Fix up the block setup code

* Fix the availability

* Update bundle

* Simplify the layout grid block registration.

* Update the bundle js files

* Fix minor prettier issue.

* Bump map since it changed

* bump the latest version of Gutenberg

* Update the bundle

* Update gutenberg ref

* Generate bundle

* Bump Gutenberg

* Update Gutenberg ref

* Update gutenberg ref

* Install latest packages

* Install latest packages

* Remove duplicative release note

* Bump Gutenberg

* Update extra node modules resolver

Gutenberg mobile dependencies were resolved using the Jetpack path, so now we check first if the module exists in the Jetpack submodule before solving it with that path.

* Remove email-validator dependency

This dependency is already defined in Jetpack submodule and it's only used there.

* Remove yarn.lock file

* Remove yarn dependency

* Clarify comment in extra node modules resolver

* Update Gutenberg ref with merge commit

* Bump Gutenberg

* Release script: Update gb mobile version to 1.56.0

* Release script: Update gutenberg ref

* Release script: Update bundle for: 1.56.0

* Update Release notes

Co-authored-by: Cameron Voell <cameronvoell@gmail.com>
Co-authored-by: Ceyhun Ozugur <ceyhunozugur@gmail.com>
Co-authored-by: Amanda Riu <amanda.riu@automattic.com>
Co-authored-by: David Calhoun <438664+dcalhoun@users.noreply.github.com>
Co-authored-by: Carlos Garcia <fluiddot@gmail.com>
Co-authored-by: Antonis Lilis <antonis.lilis@automattic.com>
Co-authored-by: Paul Von Schrottky <paul.von.schrottky@automattic.com>
Co-authored-by: Enej Bajgoric <enej.bajgoric@automattic.com>
Co-authored-by: AmandaRiu <5810477+AmandaRiu@users.noreply.github.com>
Co-authored-by: Stefanos Togkoulidis <stefanostogoulidis@gmail.com>
Co-authored-by: Siobhan <siobhan@automattic.com>
Co-authored-by: Oguz Kocer <oguz.kocer@automattic.com>
Co-authored-by: Oguz Kocer <oguzkocer@users.noreply.github.com>
Co-authored-by: Siobhan Bamber <SiobhyB@users.noreply.github.com>
geriux added a commit to wordpress-mobile/gutenberg-mobile that referenced this pull request Jun 25, 2021
* Release 1.56.0 (#3664)

* Update gutenberg reference

* Update package-lock

* Update gutenberg ref

* Updated gutenberg ref

* Updating gutenberg ref

* Updated hermes executable to hermesc for building bundle

* Updated bundle

* Update gutenberg ref

* Add changes to package-lock.json after running npm install

* Disabled npm cache on CI

* Update gutenberg ref

* Add @react-native to transformIgnorePatterns in jest config

Expecting this to fix the following error:
```
/home/circleci/project/gutenberg/node_modules/@react-native/polyfills/error-guard.js:14
type ErrorHandler = (error: mixed, isFatal: boolean) => void;
        ^^^^^^^^^^^^

SyntaxError: Unexpected identifier

    at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/node_modules/@jest/transform/build/ScriptTransformer.js:537:17)
    at Object.<anonymous> (gutenberg/node_modules/react-native/jest/setup.js:434:6)
```

* Update gutenberg ref

* Update gutenberg ref

* updated gutenberg ref

* Upgrade react-native related devDependencies

* Update gutenberg ref

* Fix check correctness diff error

* Update gutenberg ref

* Update gutenberg ref

* Updated bundle files

* Updated gutenberg ref

* Updated gutenberg ref

* Updated gutenberg ref

* Adding cache-version file for re-running circle-ci

* Update gutenberg ref

* Updated gutenberg ref

* Updated ref, removed react-native-mirror s3 from bridge gradle

* updated bundle

* Update podspecs by running generate-podspecs.sh script

* Updating gutenberg ref

* Update bundle

* Update gutenberg ref

* Revert "Disabled npm cache on CI"

This reverts commit 3958c64.

* Modify generate-podspecs.sh script to run FBReactNativeSpec codegen ahead of time

* Update gutenberg ref

* Update package-lock.json

* Update package-lock.json

* Add workaround for FBReactNativeSpec podspec in generate-poscpecs.sh script

* Update commit hash of FBReactNativeSpec

* Fix typo

* Update commit hash of FBReactNativeSpec

* Add missing external podspecs to generate-podspecs.sh script

* Re-generate third-party-podspecs, remove react-native-linear-gradient podspec

* Update commit hash of FBReactNativeSpec

* Add exception for react-native-slider fork

* Remove tag from react-native-slider podspec

* Fix react-native-slider git source

* Update gutenberg ref

* Update bundles

* Update gutenberg reference

* Update release notes with fix for Gboard enter detection

* Update gutenberg ref

* Update jetpack ref

* Update bundles

* Update gutenberg ref

* Update gutenberg ref

* Re-run generate-podspecs.sh to update BVLinearGradient podspec

* Update gutenberg ref

* Update bundles

* Shallow clone project for CI tasks

Decrease CI task duration by reducing depth of git operations.

- [CircleCI: Shallow Repository Cloning](https://support.circleci.com/hc/en-us/articles/360045096514-Shallow-Repository-Cloning)
- [CircleCI: How do I modify the checkout step?](https://support.circleci.com/hc/en-us/articles/115015659247-How-do-I-modify-the-checkout-step-)
- [Example: CircleCI Shallow Clone](https://discuss.circleci.com/t/shallow-clone-for-circleci-2-0-builds/20200)

* Update Gutenberg ref

* Updates gutenberg reference

* Update Gutenberg submodule ref

Fix component inspector error in React Native

* Bump Gutenberg to latest trunk

* Update gutenberg ref

* Changes to package-lock.json after running npm install

* Update bundles

* Run ./bin/generate-podspecs.sh

* Update gutenberg ref to merge commit

* Update Gutenberg ref

* Add a few improvements and checks to generate-podspecs.sh

* Add a warning field at the bottom of all podspecs

* Add a warning when the tag or commit field is missing in a podspec

* Patch react-native-blur.podspec adding the missing tag

* Better wording

* Update bundles

* Update FBReactNativeSpec ref

* Indent patch messages

* Patch react-native-blur.podspec again as 3.6.0 tag is missing

* CI fetches commit reference directly

The CI configuration is set to clone with a depth of 1. If the CI tasks
then attempts to reference an older commit in the relevant branch, an
error occurs. This might occur when a branch merge occurs between a CI
tasks beginning and the point it attempt to fetch the HEAD of the
branch. This change configures the shallow clone to fetch the specific
commit reference, rather than the HEAD of the relevant branch.

* Update gutenberg reference

* Update gutenberg ref

* Update gutenberg ref

* Update gutenberg ref

* Update gutenberg ref

* Update bundles

* Generate build

* Moved item to the unreleased section of release notes

* Update Gutenberg ref with merge commit

* Bump Gutenberg hash

* Update Gutenberg hash

* Bump Gutenberg hash

* Update Gutenberg hash

* Update Gutenberg hash

* Temporary Metro patch until RN upgrades Metro

Issue message: "Error: EISDIR: illegal operation on a directory, read"
Fix PR on Metro: facebook/metro#567

* Bump Gutenberg hash

* Bump Gutenberg to the merged hash

* Update Gutenberg ref

* Update release notes

* Fix incorrect block insertion point after blurring post title

Selecting the title selection status within the same `useSelect` for
reusable blocks caused the title selection status to become stale, due
to the dependency array for the `useSelect` hook.

The staleness caused the block insertion point to show up in the
incorrect location after blurring the title text input.

* Update gutenberg ref

* Bump Gutenberg

* Update RELEASE-NOTES.txt

* Update Gutenberg hash which contains fix to Android artifact publishing

* Bump Gutenberg

* Add: Grid block, from block-experiments repo

* Bump block-expeiments

* Update the no_output_timeout to 15min

* Revert the longer timeout.

* Add block-experiments to eslintignore

* Remove comment.

* Fix prettier

* Bump block-experiements

* All Layout Grid controls

* Bump block experiment fixes

* Fix up the block setup code

* Fix the availability

* Update bundle

* Simplify the layout grid block registration.

* Update the bundle js files

* Fix minor prettier issue.

* Bump map since it changed

* bump the latest version of Gutenberg

* Update the bundle

* Update gutenberg ref

* Generate bundle

* Bump Gutenberg

* Update Gutenberg ref

* Update gutenberg ref

* Install latest packages

* Install latest packages

* Remove duplicative release note

* Bump Gutenberg

* Update extra node modules resolver

Gutenberg mobile dependencies were resolved using the Jetpack path, so now we check first if the module exists in the Jetpack submodule before solving it with that path.

* Remove email-validator dependency

This dependency is already defined in Jetpack submodule and it's only used there.

* Remove yarn.lock file

* Remove yarn dependency

* Clarify comment in extra node modules resolver

* Update Gutenberg ref with merge commit

* Bump Gutenberg

* Release script: Update gb mobile version to 1.56.0

* Release script: Update gutenberg ref

* Release script: Update bundle for: 1.56.0

* Update Release notes

Co-authored-by: Cameron Voell <cameronvoell@gmail.com>
Co-authored-by: Ceyhun Ozugur <ceyhunozugur@gmail.com>
Co-authored-by: Amanda Riu <amanda.riu@automattic.com>
Co-authored-by: David Calhoun <438664+dcalhoun@users.noreply.github.com>
Co-authored-by: Carlos Garcia <fluiddot@gmail.com>
Co-authored-by: Antonis Lilis <antonis.lilis@automattic.com>
Co-authored-by: Paul Von Schrottky <paul.von.schrottky@automattic.com>
Co-authored-by: Enej Bajgoric <enej.bajgoric@automattic.com>
Co-authored-by: AmandaRiu <5810477+AmandaRiu@users.noreply.github.com>
Co-authored-by: Stefanos Togkoulidis <stefanostogoulidis@gmail.com>
Co-authored-by: Siobhan <siobhan@automattic.com>
Co-authored-by: Oguz Kocer <oguz.kocer@automattic.com>
Co-authored-by: Oguz Kocer <oguzkocer@users.noreply.github.com>
Co-authored-by: Siobhan Bamber <SiobhyB@users.noreply.github.com>

* Update Gutenberg ref

Co-authored-by: Cameron Voell <cameronvoell@gmail.com>
Co-authored-by: Ceyhun Ozugur <ceyhunozugur@gmail.com>
Co-authored-by: Amanda Riu <amanda.riu@automattic.com>
Co-authored-by: David Calhoun <438664+dcalhoun@users.noreply.github.com>
Co-authored-by: Carlos Garcia <fluiddot@gmail.com>
Co-authored-by: Antonis Lilis <antonis.lilis@automattic.com>
Co-authored-by: Paul Von Schrottky <paul.von.schrottky@automattic.com>
Co-authored-by: Enej Bajgoric <enej.bajgoric@automattic.com>
Co-authored-by: AmandaRiu <5810477+AmandaRiu@users.noreply.github.com>
Co-authored-by: Stefanos Togkoulidis <stefanostogoulidis@gmail.com>
Co-authored-by: Siobhan <siobhan@automattic.com>
Co-authored-by: Oguz Kocer <oguz.kocer@automattic.com>
Co-authored-by: Oguz Kocer <oguzkocer@users.noreply.github.com>
Co-authored-by: Siobhan Bamber <SiobhyB@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants