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

string export default is considered as code during generate #15115

Closed
huang-julien opened this issue Oct 9, 2022 · 0 comments · Fixed by nuxt/framework#8536
Closed

string export default is considered as code during generate #15115

huang-julien opened this issue Oct 9, 2022 · 0 comments · Fixed by nuxt/framework#8536

Comments

@huang-julien
Copy link
Member

huang-julien commented Oct 9, 2022

Environment

  • Operating System: Linux
  • Node Version: v16.15.0
  • Nuxt Version: 3.0.0-rc.11
  • Nitro Version: 0.5.4
  • Package Manager: yarn@3.2.3
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/nuxt-starter-563znx?file=pages%2Findex.vue

Describe the bug

Hi 👋 , strange issue happening only with lang="ts". at line 30 in page/index.vue the export default is considered as part of the component code. It triggers a multiple default warning during static generation.

Current workaround is to avoid typescript by removing lang="ts"

this might be an upstream issue ?

Additional context

No response

Logs

WARN Error when using sourcemap for reporting an error: Can't resolve original location of error. 15:25:34

ERROR Duplicate export 'default' (Note that you need plugins to import files that are not JavaScript) 15:25:34
file: /home/projects/nuxt-starter-563znx/pages/index.vue?macro=true&vue&type=script&setup=true&lang.ts:27:7
25: });
26:
27: export default {}
^
28: export const meta = {
29: layout: "default"

ERROR Duplicate export 'default' (Note that you need plugins to import files that are not JavaScript) 15:25:34

at error (node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:1888:30)
at error (node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:12459:16)
at tryParse (node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:12836:25)
at setSource (node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:12741:24)
at addModuleSource (node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:22183:20)
at ()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants