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

Bug in Vue Layouts example #724

Closed
shortpoet opened this issue Mar 20, 2023 · 2 comments
Closed

Bug in Vue Layouts example #724

shortpoet opened this issue Mar 20, 2023 · 2 comments

Comments

@shortpoet
Copy link

Description

ReferenceError: _sfc_main is not defined

This bug is referenced in this issue. If the example is run from the monorepo, all tests pass. If you pull the example out and run just the example in isolation, the bug will be encountered. I tried to add the repro to stackblitz, but couldn't get it to run there.

I think there is an open issue in Vue about it. It gave me a clue to fix the 'bug.' I have no idea why the monorepo seems to avoid the issue and would love to learn if you know.

The fix is to change this line

from

export { default as Layout } from './Layout.vue'

to

import { default as Layout } from './Layout.vue'
export { Layout }

I can confirm that tests still pass (the ones that didn't fail otherwise) on the monorepo with this change. Would love the opportunity to submit a PR if appropriate.

Error Message + Error Stack

ReferenceError: _sfc_main is not defined
    at eval (/pages/index.page.vue:16:20)
    at async instantiateModule (file:///Users/Shared/source/repos/zorbae/vps-repro-vue-layouts/node_modules/.pnpm/vite@4.1.4/node_modules/vite/dist/node/chunks/dep-ca21228b.js:52420:9)
@brillout
Copy link
Member

Hm, that's quite surprising indeed. And in many ways.

Yea, PR welcome to update that line!

@brillout brillout removed the bug 💥 label Mar 20, 2023
@brillout
Copy link
Member

Closing since it's not really a VPS bug. Looking forward to your PR.

@brillout brillout closed this as not planned Won't fix, can't repro, duplicate, stale Mar 20, 2023
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

2 participants