feathers-vuex: FeathersVuexPagination.js: export 'createElement' was not found in '@vue/composition-api
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'
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 5
- Comments: 27 (20 by maintainers)
@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:The
createElement
function that was imported has been aliased to justh
as a convention (see: here)When using vite, this produces a build error:
Thanx! I understand it.
I found a package for removing warn: https://github.com/markogresak/ignore-not-found-export-webpack-plugin
Same problem, please release the fixed version. Thanx!
If it’s possible to make it flexibly handle both, that’s definitely the best solution for right now. @J3m5 the people working on the composition api have been actively making it match vue-next, so I think it will be fine to make the updates. We can release it as a minor. I’ll outline the details in the release notes.
@marshallswain I went ahead and opened up a PR #612 with a simple patch to fix this in case you want to take a look.
I’d appreciate it, since this is causing errors for vite builds. Thanks!
Just to be clear, I’m still seeing the warning in the console. The functionality will work as expected. If you get too caught up on the warnings, you might not get any work published. 😉
The code rewrites the
createElement
variable to be whichever import is actually available.You still import createElement from @vue/composition-api in vuex-pagination, but later then version 1.0 it does not contains it. Is completly removed and renamed for h.
@GaborTorma try installing
@vue/composition-api@12.2.3
, which I just published with this change:The warning about peerDeps should be fixed.
Did you use
"@vue/composition-api": "=1.0.0-beta.11"
and"feathers-vuex": "=3.12.2"
?@TeleMediaCC I just updated one of my apps from
@vue/composition-api@0.6.7
to@vue/composition-api@1.0.0-beta.11
and it’s working in both cases. Just to make sure, I’m testing pages that use the FeathersVuexPagination component. I’m going to try another app, but if you can maybe share a repo that would be great.I still get the WARN on installing:
npm WARN feathers-vuex@3.12.0 requires a peer of @vue/composition-api@^0.6.1 but none is installed. You must install peer dependencies yourself.
…and now get a new error when runing:
"@vue/composition-api": "=1.0.0-beta.11"
Ty! @phatj