Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

fix: missing types #17

Closed
wants to merge 2 commits into from
Closed

fix: missing types #17

wants to merge 2 commits into from

Conversation

billyyyyy3320
Copy link
Member

@billyyyyy3320 billyyyyy3320 commented Aug 8, 2019

Summary

yarn build:

[build:client] src/client/classification.ts(5,30): error TS2307: Cannot find module '../types/VuePress'.
[build:client] npm ERR! code ELIFECYCLE
npm ERR! errno 2
[build:client] npm ERR! @vuepress/[email protected] build:client: `tsc -p tsconfig.client.json`
[build:client] npm ERR! Exit status 2
[build:client] npm ERR! 
[build:client] npm ERR! Failed at the @vuepress/[email protected] build:client script.
[build:client] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[build:client] 
[build:client] npm ERR! A complete log of this run can be found in:
[build:client] npm ERR!     /Users/billy/.npm/_logs/2019-08-08T16_57_26_478Z-debug.log
[build:client] npm run build:client exited with code 2
[build:node] src/node/handleOptions.ts(34,37): error TS2339: Property 'sourceDir' does not exist on type 'VuePressContext'.
[build:node] src/node/handleOptions.ts(97,16): error TS2459: Type 'VuePressPage' has no property 'regularPath' and no string index signature.
[build:node] src/node/index.ts(10,38): error TS2339: Property 'themeAPI' does not exist on type 'VuePressContext'.
[build:node] src/node/index.ts(42,15): error TS2459: Type 'VuePressPage' has no property 'frontmatter' and no string index signature.
[build:node] src/node/index.ts(63,15): error TS2459: Type 'VuePressContext' has no property 'pages' and no string index signature.
[build:node] src/node/index.ts(143,61): error TS2339: Property 'addPage' does not exist on type 'VuePressContext'.
[build:node] src/node/interface/VuePress.ts(4,8): error TS2307: Cannot find module '../../types/VuePress'.
[build:node] src/node/pagination.ts(60,13): error TS2459: Type 'VuePressContext' has no property 'pages' and no string index signature.
[build:node] src/node/pagination.ts(96,50): error TS2339: Property 'addPage' does not exist on type 'VuePressContext'.
[build:node] src/node/util.ts(84,40): error TS2339: Property 'frontmatter' does not exist on type 'VuePressPage'.
[build:node] src/node/util.ts(85,40): error TS2339: Property 'frontmatter' does not exist on type 'VuePressPage'.
[build:node] npm ERR! code ELIFECYCLE
[build:node] npm ERR! errno 2
[build:node] npm ERR! @vuepress/[email protected] build:node: `tsc -p tsconfig.node.json`
[build:node] npm ERR! Exit status 2
[build:node] npm ERR! 
[build:node] npm ERR! Failed at the @vuepress/[email protected] build:node script.
[build:node] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[build:node] 
[build:node] npm ERR! A complete log of this run can be found in:
[build:node] npm ERR!     /Users/billy/.npm/_logs/2019-08-08T16_57_26_958Z-debug.log
[build:node] npm run build:node exited with code 2

File: ./src/node/interface/VuePress.ts
Screen Shot 2019-08-09 at 00 29 16

File: ./src/client/classification.ts
Screen Shot 2019-08-09 at 00 29 38

I think It's because we ignore all the types folder:

// .gitignore
# Output
lib
.temp
types    // <<< here
src/**/*.js
dist
...

I guess you wanted to ignore /types. However, maybe there's a file /src/types and it has been ignored, too. I created a new folder src/interface with types which I found in previous commit.

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.)

  • Chrome
  • Firefox
  • Safari
  • Edge
  • IE

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature
  • Related documents have been updated
  • Related tests have been updated

To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

Later, I found my previous commit will break output structure:

lib/
├── client
│   ├── client
│   ├── components
│   └── interface
└── node
    ├── interface
    └── node

So I modified ts config to fix it:

lib/
├── client
│   ├── classification.js
│   ├── components
│   ├── components.js
│   └── pagination.js
├── interface
│   └── VuePress.js
└── node
    ├── handleOptions.js
    ├── index.js
    ├── interface
    ├── pagination.js
    └── util.js

@ulivz Can you check your local repo?

@billyyyyy3320
Copy link
Member Author

fixed by #22

@billyyyyy3320 billyyyyy3320 deleted the fix/types branch September 28, 2019 03:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants