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

Error building after last update #63

Closed
miguelfspinto opened this issue May 5, 2021 · 14 comments
Closed

Error building after last update #63

miguelfspinto opened this issue May 5, 2021 · 14 comments

Comments

@miguelfspinto
Copy link

Hi,

After the last update for version 0.8, i cannot run build on my app:

RROR Failed to compile with 42 errors7:36:04 PM
error in ./node_modules/@vueuse/core/node_modules/vue-demi/lib/index.esm.mjs
Can't reexport the named export 'computed' from non EcmaScript module (only default export is available)
error in ./node_modules/@vueuse/core/node_modules/vue-demi/lib/index.esm.mjs
Can't reexport the named export 'createApp' from non EcmaScript module (only default export is available)
error in ./node_modules/@vueuse/core/node_modules/vue-demi/lib/index.esm.mjs
Can't reexport the named export 'customRef' from non EcmaScript module (only default export is available)
error in ./node_modules/@vueuse/core/node_modules/vue-demi/lib/index.esm.mjs
Can't reexport the named export 'defineComponent' from non EcmaScript module (only default export is available)
error in ./node_modules/@vueuse/core/node_modules/vue-demi/lib/index.esm.mjs
Can't reexport the named export 'del' from non EcmaScript module (only default export is available)
error in ./node_modules/@vueuse/core/node_modules/vue-demi/lib/index.esm.mjs
Can't reexport the named export 'getCurrentInstance' from non EcmaScript module (only default export is available)
error in ./node_modules/@vueuse/core/node_modules/vue-demi/lib/index.esm.mjs
Can't reexport the named export 'h' from non EcmaScript module (only default export is available)

@antfu
Copy link
Member

antfu commented May 5, 2021

Can't reproduce on my side, can you try a clean install or provide a minimal reproduction? Thanks

@lstoeferle
Copy link
Member

For me it's the same error after upgrading to v0.8. I use it in a vue2 web-component project, where vue and @vue/composition-api are located in the devDependencies.

@antfu
Copy link
Member

antfu commented May 6, 2021

Can I have the content of vue-demi/lib/index.esm.mjs? Still, ideally a repro is preferred.

@lstoeferle
Copy link
Member

Unfortunately I can not share the repo, since it belongs to the company I'm working for :(
vue2, vue-demi, @vue/composition-api, @vue/cli (webcomponent build), webpack

// vue-demi/lib/index.esm.mjs
import Vue from 'vue'
import VueCompositionAPI from '@vue/composition-api'

function install(_vue) {
  _vue = _vue || Vue
  if (_vue && !_vue['__composition_api_installed__'])
    Vue.use(VueCompositionAPI)
}

install(Vue)

var isVue2 = true
var isVue3 = false
var Vue2 = Vue
var version = Vue.version

/**VCA-EXPORTS**/
export { computed, createApp, createRef, customRef, defineAsyncComponent, defineComponent, del, getCurrentInstance, h, inject, isRaw, isReactive, isReadonly, isRef, markRaw, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onServerPrefetch, onUnmounted, onUpdated, provide, proxyRefs, reactive, readonly, ref, set, shallowReactive, shallowReadonly, shallowRef, toRaw, toRef, toRefs, triggerRef, unref, useCSSModule, useCssModule, warn, watch, watchEffect } from '@vue/composition-api'
/**VCA-EXPORTS**/

export {
  Vue,
  Vue2,
  isVue2,
  isVue3,
  version,
  install,
}

@miguelfspinto
Copy link
Author

Still having the same error after update 0.8.1
@antfu , i'm gonna add you to the repo. Do you have gitlab account?

error in ./node_modules/@vueuse/core/node_modules/vue-demi/lib/index.esm.mjs
Can't reexport the named export 'computed' from non EcmaScript module (only default export is available)
error in ./node_modules/@vueuse/core/node_modules/vue-demi/lib/index.esm.mjs
Can't reexport the named export 'createApp' from non EcmaScript module (only default export is available)
error in ./node_modules/@vueuse/core/node_modules/vue-demi/lib/index.esm.mjs
Can't reexport the named export 'customRef' from non EcmaScript module (only default export is available)
error in ./node_modules/@vueuse/core/node_modules/vue-demi/lib/index.esm.mjs
Can't reexport the named export 'defineComponent' from non EcmaScript module (only default export is available)
error in ./node_modules/@vueuse/core/node_modules/vue-demi/lib/index.esm.mjs
Can't reexport the named export 'del' from non EcmaScript module (only default export is available)
error in ./node_modules/@vueuse/core/node_modules/vue-demi/lib/index.esm.mjs
Can't reexport the named export 'getCurrentInstance' from non EcmaScript module (only default export is available)
error in ./node_modules/@vueuse/core/node_modules/vue-demi/lib/index.esm.mjs

@fk1blow
Copy link

fk1blow commented May 6, 2021

i m having the same issue on osx with node v15.14.0.
I m specifying the node version b/c the same app running on ubuntu with node v12.20.0 seems fine

@fedeee
Copy link

fedeee commented May 6, 2021

FYI: this also relates to: vuejs/apollo#1190

@antfu antfu closed this as completed in 0689015 May 6, 2021
@antfu
Copy link
Member

antfu commented May 6, 2021

0.9.0 released. Would need some help to confirm if it's a fix. Thanks!

@fk1blow
Copy link

fk1blow commented May 6, 2021

@antfu i m having @vueuse/core as a dependency so i could try that one specifically

@fedeee
Copy link

fedeee commented May 6, 2021

This seems to have fixed it for us

@JuroOravec
Copy link

@antfu 0.9.0 fixes the issue with vuejs/vue-apollo (vuejs/apollo#1190), thanks!

@jzs11
Copy link

jzs11 commented Sep 9, 2021

This error is coming back after upgrade to the latest

image

@Muchmorepig
Copy link

I met the same issue:
image

@jzs11
Copy link

jzs11 commented Sep 14, 2021

Try this - vueuse/vueuse#718 (comment) it works for me

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

No branches or pull requests

8 participants