#A module cannot have multiple default exports.ts(2528)

23 messages · Page 1 of 1 (latest)

thin pike
#

New to vue and ts.
I was trying to export example of data option and i get this error.

Thank you.

zinc shore
#

@thin pike Is that the entire file on the right?

thin pike
#

wdym?

#

oh, no, that's 2 different

#

2 different projects with the same error.

#

both with a single default export

wheat egret
#

@thin pike the problem lies in your <script> tag

#

<script setup> is for the Composition API, where you just declare stuff but don't export anything

thin pike
#

how do i make it so it's for option api?

wheat egret
#

if you want to use the Options API, use <script>

thin pike
#

okay, i'll try

wheat egret
#

literally the 1st page of the docs ^^'

thin pike
#

Thank you so much

#

i was following create vite@latest template and din't notice it in the guide

wheat egret
#

I mean, the Vite template is just a template

#

to generate the boilerplate for you

#

always refer to the offical docs if you are unsure about something ok

#

(also looking up the error message in Google might also give you clues)

thin pike
#

anyway, how do i close this... post

wheat egret
#

!resolved