Skip to content

Vue nestesd SFC does not play well with Astro #10

Open
@louiss0

Description

@louiss0
package version
vue 3.3.4
vite 4.3.4
vite-plugin-vue-nested-sfc 0.1.2
vite 4.3.4
astrojs/vue 2.2.0

I was trying to migrate my app to using this plugin when I ran into this error. It was caused by me trying to import a component into Astro that was using the <component/> . It also happens when trying to import a component that does not really have a default or a script tag at all.

 error   The argument 'path' must be a string or Uint8Array without null bytes. Received '/src/components/\x00plugin-vue:export-helper'
 [vite] Error when evaluating SSR module /home/louiss/main/web-projects/monorepo/personal-projects/apps/portfolio/src/pages/index.astro: failed to import "/src/components/BaseComponents.vue"
|- TypeError [ERR_INVALID_ARG_VALUE]: The argument 'path' must be a string or Uint8Array without null bytes. Received '/src/components/\x00plugin-vue:export-helper'
    at open (node:internal/fs/promises:538:10)
    at Object.readFile (node:internal/fs/promises:909:20)
    at loadAndTransform (file:///home/louiss/main/web-projects/monorepo/personal-projects/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:53332:41)

Link to minimal Repoducible Example

This link will lead to an example where I try to import three components.
They come from module called ./components/Components.vue You see them immediately. Please tell me when you are done.

https://stackblitz.com/edit/withastro-astro-3en7fb?file=src%2Fpages%2Findex.astro

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions