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

fix(gatsby): fix error cannot read referencePath of undefined #20517

Conversation

muescha
Copy link
Contributor

@muescha muescha commented Jan 9, 2020

Description

fixes an error in the file find-api-calls.js:

parsing error {
  file: 'gatsby/src/utils/api-runner-node.js',
  e: TypeError: Cannot read property 'referencePaths' of undefined
      at CallExpression (/Users/muescha/Work/gatsby/github/gatsby/www/plugins/
gatsby-transformer-gatsby-api-calls/find-api-calls.js:123:52)

since the file api-runner-node-error-parser.js is an helper function and not need a link to the source i assume it can be fixed with a "monkey patch": renaming the file:

from: api-runner-node-error-parser.js
to: api-runner-error-parser.js

see #20488

Related Issues

fixes #20488

@muescha muescha requested a review from a team as a code owner January 9, 2020 19:06
Copy link
Contributor

@sidharthachatterjee sidharthachatterjee left a comment

Choose a reason for hiding this comment

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

Thanks!

Left a small suggestion

packages/gatsby/src/utils/api-runner-node.js Outdated Show resolved Hide resolved
Copy link
Contributor

@sidharthachatterjee sidharthachatterjee 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 so much!

@sidharthachatterjee sidharthachatterjee added the bot: merge on green Gatsbot will merge these PRs automatically when all tests passes label Jan 10, 2020
@gatsbybot gatsbybot merged commit c759a7d into gatsbyjs:master Jan 10, 2020
@muescha muescha deleted the muescha/fix/error-cannot-read-property-referencepaths-of-undefined branch January 10, 2020 18:49
@adrienharnay
Copy link
Contributor

I (kind of) have the same error:

TypeError: Cannot read property 'match' of undefined
  
  - api-runner-node-error-parser.js:39 errorParser
    [front-end]/[gatsby]/dist/utils/api-runner-node-error-parser.js:39:33
  
  - api-runner-node.js:398 
    [front-end]/[gatsby]/dist/utils/api-runner-node.js:398:29

But applying the changes from this PR doesn't seem to fix it... Would you an idea?

Thanks in advance

@muescha
Copy link
Contributor Author

muescha commented Jan 13, 2020

Thats a different error

This PR fix an error in find-api-calls.js (See #20488)

@muescha
Copy link
Contributor Author

muescha commented Jan 13, 2020

It would be very helpful if you open an new issue with the new error

@shicholas
Copy link
Contributor

I (kind of) have the same error:

TypeError: Cannot read property 'match' of undefined
  
  - api-runner-node-error-parser.js:39 errorParser
    [front-end]/[gatsby]/dist/utils/api-runner-node-error-parser.js:39:33
  
  - api-runner-node.js:398 
    [front-end]/[gatsby]/dist/utils/api-runner-node.js:398:29

But applying the changes from this PR doesn't seem to fix it... Would you an idea?

Thanks in advance

@adrienharnay, I had something similar then managed to get it working with a fresh package install and deleting the .cache directory. I hope that helps.

@muescha
Copy link
Contributor Author

muescha commented Jan 24, 2020

@adrienharnay please look at PR #20730 - maybe this PR fix your problem

@adrienharnay
Copy link
Contributor

Hey, actually it was an opaque error from gatsby-source-graphql... So not related, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: merge on green Gatsbot will merge these PRs automatically when all tests passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

api-runner-node.js: TypeError: Cannot read property 'referencePaths' of undefined
5 participants