Skip to content

fix($core): cannot read property 'path' of undefined #1906

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

Merged
merged 1 commit into from
Oct 4, 2019

Conversation

Raiondesu
Copy link
Contributor

@Raiondesu Raiondesu commented Oct 3, 2019

Summary

When layout is not present in a theme, the following shows up in console:

tip Apply theme vuepress-theme-.vuepress (extends vuepress-theme-vuepress-theme) ...
TypeError: Cannot read property 'path' of undefined
    at ThemeAPI.getLayoutComponentMap (@vuepress\core\lib\node\theme-api\index.js:83:67)
    at ThemeAPI.init (@vuepress\core\lib\node\theme-api\index.js:35:36)
    at new ThemeAPI (@vuepress\core\lib\node\theme-api\index.js:17:10)
    at loadTheme (@vuepress\core\lib\node\loadTheme.js:59:10)
    at App.process (@vuepress\core\lib\node\App.js:100:21)
    at dev (@vuepress\core\lib\index.js:14:13)
    at args (vuepress\lib\util.js:35:12)
    at CAC.cli.command.option.option.option.option.option.option.option.option.option.action (vuepress\lib\registerCoreCommands.js:38:23)
    at CAC.runMatchedCommand (cac\dist\index.js:700:38)
    at CAC.parse (cac\dist\index.js:620:18)
    at CLI (vuepress\lib\util.js:23:7)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)

This PR fixes this issue, by removing a reference to an obvious undefined value (Layout).

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Build-related changes
  • Other, please describe:

If changing the UI of default theme, please provide the before/after screenshot:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)

You have tested in the following browsers: (Providing a detailed version will be better.)

This issue does not correspond to a browser, it's a node-related problem

  • Chrome
  • Firefox
  • Safari
  • Edge
  • IE

@Raiondesu Raiondesu changed the title Update index.js - fix cannot read property 'path' of undefined fix($core): cannot read property 'path' of undefined Oct 3, 2019
@ulivz ulivz merged commit 8d07675 into vuejs:master Oct 4, 2019
@vue-bot
Copy link

vue-bot commented Oct 4, 2019

Hey @Raiondesu, thank you for your time and effort spent on this PR, contributions like yours help make Vue better for everyone. Cheers! 💚

@Raiondesu Raiondesu deleted the patch-2 branch October 11, 2019 12:38
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