question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FeathersVuexPagination.js: export 'createElement' was not found in '@vue/composition-api

See original GitHub issue

Steps to reproduce

Fresh, new install in Nuxt 2.1:

// plugins/featers-client
import feathers from '@feathersjs/feathers'
import socketio from '@feathersjs/socketio-client'
import auth from '@feathersjs/authentication-client'
import io from 'socket.io-client'

import { CookieStorage } from 'cookie-storage'

let API_URL = 'https://app.bligson.com/api'

if (window.location.hostname === 'localhost') {
  API_URL = 'http://localhost:3030'
}

const socket = io(API_URL, {
  transports: ['websocket']
})

const storage = new CookieStorage()

const feathersClient = feathers()
  .configure(socketio(socket))
  .configure(auth({ storage }))

export default feathersClient

And then:

// store/auth.js
import feathersVuex from 'feathers-vuex'
import feathersClient from '@/plugins/feathers-client'

const {
  service,
  auth,
  FeathersVuex
} = feathersVuex(feathersClient, {
  idField: '_id'
})

export default {
  service,
  auth,
  FeathersVuex
}


First attempt I get warning I need to install @vue/composition-api Was not clear from docs, but npm install save ....

But now I am stuck after:

 ./node_modules/feathers-vuex/dist/FeathersVuexPagination.js                                                                                                                                                                                                                                                                       friendly-errors 12:20:52

"export 'createElement' was not found in '@vue/composition-api'   

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:27 (20 by maintainers)

github_iconTop GitHub Comments

6reactions
phatjcommented, Jul 11, 2020

@tvld, the composition API entered beta status and broke a couple of things.

Use @vue/composition-api@0.6.7 (version 0.6.7) instead:

yarn add @vue/composition-api@0.6.7

# or
npm install @vue/composition-api@0.6.7 --save

The createElement function that was imported has been aliased to just h as a convention (see: here)

Aliasing createElement to h is a common convention you’ll see in the Vue ecosystem and is actually required for JSX. Starting with version 3.4.0 of the Babel plugin for Vue, we automatically inject const h = this.$createElement in any method and getter (not functions or arrow functions), declared in ES2015 syntax that has JSX, so you can drop the (h) parameter. With prior versions of the plugin, your app would throw an error if h was not available in the scope.

2reactions
philipimperatocommented, May 4, 2021

When using vite, this produces a build error:

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

export 'createElement' was not found in '@vue/composition-api
FeathersVuexPagination.js: export 'createElement' was not found in '@vue/composition-api.
Read more >
vue.js - "export 'default' (imported as 'Vue') was not found in 'vue'
The reason this is happening is because in Vue 2, Vue provides a default export export default vue , which allows BootstrapVue to...
Read more >
Composition API | FeathersVuex
With the Vue Composition API, there's no this object. It has been replaced by the context object. So, only when using the composition...
Read more >
API - esbuild
This API call is used by the command-line interface if no input files are provided and the --bundle flag is not present. In...
Read more >
Vue's Composition API - CODE Magazine
npm i @vue/composition-api --save ... No magic, just JavaScript. ... import { ref } from "@vue/composition-api"; export default { setup() ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found