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

TypeError: Cannot read property 'get' of undefined #108

Closed
hishark opened this issue Apr 6, 2021 · 13 comments
Closed

TypeError: Cannot read property 'get' of undefined #108

hishark opened this issue Apr 6, 2021 · 13 comments

Comments

@hishark
Copy link

hishark commented Apr 6, 2021

你好,我按照安装步骤进行安装,输入 yarn develop 之后报错日志如下:

yarn run v1.22.10
$ gatsby develop
success open and validate gatsby-configs - 0.088s
success load plugins - 1.492s
success onPreInit - 0.065s
success initialize cache - 0.017s
success copy gatsby files - 0.084s
success onPreBootstrap - 0.017s
success createSchemaCustomization - 0.201s
success Checking for changed pages - 0.002s
success source and transform nodes - 0.499s
success building schema - 0.257s
info Total nodes: 1795, SitePage nodes: 1 (use --verbose for breakdown)
success createPages - 0.002s
success Checking for changed pages - 0.000s
success createPagesStatefully - 0.053s
success update schema - 0.024s
success write out redirect data - 0.001s
success onPostBootstrap - 0.002s
info bootstrap finished - 6.159s
success onPreExtractQueries - 0.001s
success extract queries from components - 0.387s
success write out requires - 0.006s
success run static queries - 0.098s - 2/2 20.38/s
success run page queries - 0.014s - 3/3 209.83/s

ERROR

Cannot read property 'get' of undefined



  TypeError: Cannot read property 'get' of undefined

  - DefinePlugin.js:549 Object.keys.forEach.key
    [running_page]/[webpack]/lib/DefinePlugin.js:549:57

  - Array.forEach

  - DefinePlugin.js:545 walkDefinitionsForValues
    [running_page]/[webpack]/lib/DefinePlugin.js:545:31

  - DefinePlugin.js:571 compiler.hooks.compilation.tap
    [running_page]/[webpack]/lib/DefinePlugin.js:571:5


  - Hook.js:154 SyncHook.lazyCompileHook
    [running_page]/[tapable]/lib/Hook.js:154:20

  - Compiler.js:631 Compiler.newCompilation
    [running_page]/[gatsby]/[webpack]/lib/Compiler.js:631:26

  - Compiler.js:667 hooks.beforeCompile.callAsync.err
    [running_page]/[gatsby]/[webpack]/lib/Compiler.js:667:29


  - Hook.js:154 AsyncSeriesHook.lazyCompileHook
    [running_page]/[tapable]/lib/Hook.js:154:20

  - Compiler.js:662 Compiler.compile
    [running_page]/[gatsby]/[webpack]/lib/Compiler.js:662:28

  - Watching.js:77 compiler.hooks.watchRun.callAsync.err
    [running_page]/[gatsby]/[webpack]/lib/Watching.js:77:18



  - index.js:173 watchRunHook
    [running_page]/[webpack-virtual-modules]/index.js:173:5



not finished Building development bundle - 2.619s

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

我自己查了查也找不到解决方法,想请教一下是哪里出了问题呢?感谢 ☺️

@shaonianche
Copy link
Collaborator

@hishark
Hi,我尝试在 mac 下使用 yarn develop 和 gatsby develop 都可以构建成功,请问你使用的什么操作系统运行命令呢?
38851617677245_ pic_hd

@yihong0618
Copy link
Owner

yihong0618 commented Apr 6, 2021

@hishark
我按报错信息搜了下,gatsbyjs/gatsby#26403
gatsbyjs/gatsby#11637
不知道是不是这个问题~

@hishark
Copy link
Author

hishark commented Apr 6, 2021

@hishark
Hi,我尝试在 mac 下使用 yarn develop 和 gatsby develop 都可以构建成功,请问你使用的什么操作系统运行命令呢?
38851617677245_ pic_hd

我也是用的 macos 耶哭了

@hishark
Copy link
Author

hishark commented Apr 6, 2021

@hishark
我按报错信息搜了下,gatsbyjs/gatsby#26403
gatsbyjs/gatsby#11637
不知道是不是这个问题~

好的呀谢谢~我来看看

@yihong0618
Copy link
Owner

@hishark
我按报错信息搜了下,gatsbyjs/gatsby#26403
gatsbyjs/gatsby#11637
不知道是不是这个问题~

好的呀谢谢~我来看看

没事儿哈哈,不过,如果本地有问题,前期数据不多的话,可以全交给 GitHub Actions, 修改 yml 文件, 让 actions 把数据跑出来。

@hishark
Copy link
Author

hishark commented Apr 6, 2021

@hishark
我按报错信息搜了下,gatsbyjs/gatsby#26403
gatsbyjs/gatsby#11637
不知道是不是这个问题~

好的呀谢谢~我来看看

没事儿哈哈,不过,如果本地有问题,前期数据不多的话,可以全交给 GitHub Actions, 修改 yml 文件, 让 actions 把数据跑出来。

哇哈哈哈哈开心!跑起来了,npm install 的时候报了个错,是本地 xcode 的问题,查了下按照这里说的解决了,之后重新拉了一下 running_page 再按照步骤做就好啦!

@hishark hishark closed this as completed Apr 6, 2021
@yihong0618
Copy link
Owner

#cool

@phh95
Copy link

phh95 commented Sep 27, 2021

感谢yihong老师和上面的这位网友 @hishark ,我也把自己在本地部署这个项目遇到的 3 个问题及解决方法,放在这里,可能会帮到以后遇到同样问题的新朋友

image

@yihong0618
Copy link
Owner

@MFYDev can you help to add this issue to wiki?

@MFYDev
Copy link
Collaborator

MFYDev commented Sep 29, 2021

@MFYDev can you help to add this issue to wiki?

Sure. Will do that ASAP.

@yihong0618
Copy link
Owner

@MFYDev can you help to add this issue to wiki?

Sure. Will do that ASAP.

Cooooool

MFYDev added a commit to MFYDev/Running-Page-Wiki that referenced this issue Sep 29, 2021
@MFYDev
Copy link
Collaborator

MFYDev commented Sep 29, 2021

@yihong0618
Done! Please have a look:

Chinese Version: https://wiki.mfydev.run/zh/FAQ/no-xcode-or-clt/
English Version: https://wiki.mfydev.run/en/FAQ/no-xcode-or-clt/

@yihong0618
Copy link
Owner

@ Thanks a lot

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

No branches or pull requests

5 participants