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

SFC page compile error #1110

Closed
1 task done
psi-4ward opened this issue Dec 16, 2018 · 3 comments
Closed
1 task done

SFC page compile error #1110

psi-4ward opened this issue Dec 16, 2018 · 3 comments
Labels
type: bug Something isn't working

Comments

@psi-4ward
Copy link
Contributor

  • I confirm that this is a issue rather than a question.

Bug report

As far as I've seen SFCs are supported along md-Files for pages.

If I add any my-page.vue I'll get

TypeError: Cannot read property 'parseComponent' of undefined
    at Object.parse (node_modules/@vue/component-compiler-utils/dist/parse.js:14:23)
    at parse (node_modules/@vuepress/shared-utils/lib/parseVueFrontmatter.js:17:47)
    at Page.process (node_modules/@vuepress/core/lib/prepare/Page.js:125:30)

This is cause @vuepress/shared-utils/lib/parseVueFrontmatter.js gets transpiled to

    const output = component_compiler_utils_1.parse({
        source: src,
        compiler: vue_template_compiler_1.default,
        needMap: false
    });

see the wrong .default at compiler prop.
If I remove this it works as expected.
Another typescript gotcha?

Version

1.0.0-alpha.29

@ulivz
Copy link
Member

ulivz commented Dec 17, 2018

To report an issue that only happens in the scene you are in, the best and direct way is to provide a reproduction repo (e.g. vuepress-issue-example), otherwise I don't know where you are going wrong.

@psi-4ward
Copy link
Contributor Author

see https://github.com/psi-4ward/vuepress-issue-parseVueFrontmatter

$ npm i
$ npm run build


> [email protected] build vuepress-issue-example
> vuepress build archive

wait Extracting site metadata...
modulesPath: vuepress-issue-example/node_modules
tip Apply theme located at vuepress-issue-example/archive/.vuepress/theme...
[vuepress] cannot resolve plugin "vuepress-issue-example/archive/.vuepress/theme"
tip Apply plugin @vuepress/register-components (i.e. "@vuepress/plugin-register-components") ...
TypeError: Cannot read property 'parseComponent' of undefined
    at Object.parse (vuepress-issue-example/node_modules/@vue/component-compiler-utils/dist/parse.js:14:23)
    at parse (vuepress-issue-example/node_modules/@vuepress/shared-utils/lib/parseVueFrontmatter.js:16:47)
    at Page.process (vuepress-issue-example/node_modules/@vuepress/core/lib/prepare/Page.js:125:30)

@tonyxu-io
Copy link

I have the same issue, removing default solved the problem.

@ulivz ulivz added type: bug Something isn't working and removed need reproduction repo labels Feb 3, 2019
@ulivz ulivz closed this as completed in 8f5b0cd Feb 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants