-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
Dependency issue with @nuxtjs/composition-api #76
Dependency issue with @nuxtjs/composition-api #76
Comments
Landed a fix, please try to upgrade the latest @vue/composition-api plugin and try again |
@antfu thank you for reply ! Here is reproduction link: codesandbox |
I guess that |
I try to find the source code from the @nuxtjs/composition-api I guess the reason from this. |
Yeah the dilemma is that Vue CLI only happy with full js path, while Nuxt only happy with package name only, while Nuxt 3 want to have native esm support (also it's more future proof) /cc @sodatea I think ideally we should have it work without fullpath, which I can't figure out why Vue CLI failed to resolve it, can you take a look a bit? (if you want we could have a pair-programming session) |
@TonyPythoneer That's useful, thanks! /cc @danielroe or do you think we could have one more alias like (I guess the alias is overkilled by replacing the submodules) nuxtOptions.alias['@vue/composition-api/dist/vue-composition-api.esm.js'] =
this.nuxt.resolver.resolveModule(
'@vue/composition-api/dist/vue-composition-api.esm.js'
) (Update: PR nuxt-community/composition-api#517 and it's working for me) |
I try to output the source code nuxtOptions.alias['@vue/composition-api'] =
nuxtOptions.alias['@vue/composition-api'] ||
this.nuxt.resolver.resolveModule(
'@vue/composition-api/dist/vue-composition-api.esm.js'
) The output is like below: nuxtOptions.alias['@vue/composition-api'] // undefined
this.nuxt.resolver.resolveModule(
'@vue/composition-api/dist/vue-composition-api.esm.js'
) // /home/tony/tony/bdff-mainsite/node_modules/@vue/composition-api/dist/vue-composition-api.esm.js Maybe, we can use But I'm not familiar with the relationship between |
Amazing! It's worked! |
Before this PR nuxt-community/composition-api#517 gets merged, I have another workaround to this issue. import { resolve } from 'path'
const vueCompositiobnAPIFullpath = resolve("./node_modules/@vue/composition-api/dist/vue-composition-api.esm.js");
config = {
alias: {
// keep default settings
'~~': resolve(__dirname, './'),
'@@': resolve(__dirname, './'),
'~': resolve(__dirname, './'),
'@': resolve(__dirname, './'),
'assets': resolve(__dirname, './assets'), // (unless you have set a custom `dir.assets`)
'static': resolve(__dirname, './static'), // (unless you have set a custom `dir.static`)
// workaround
'@vue/composition-api/dist/vue-composition-api.esm.js': vueCompositiobnAPIFullpath,
},
} Thanks to the @antfu 's answer, he inspires me to have this workaround. So, when we have this workaround, we can enjoy @vueuse 's charm. :D |
Hi @antfu @TonyPythoneer Thanks a lot for your help. 👍👍 |
Should be fixed in v0.25.0 ❤️ - let me know if not. |
Hi @danielroe I hadn't experienced this issue previously, but I just updated to the latest version and my netlify deploy now fails with: Package subpath './dist/vue-composition-api.esm.js' is not defined by "exports" in /opt/build/repo/node_modules/@vue/composition-api/package.json It generates fine locally, and reverting to the previous version works. |
@ackushiw-flutterwave try clearing the netlify cache and redeploying |
@wheatjs I tried that, but no luck, unfortunately. I've reverted for now. |
Hi @danielroe |
@ackushiw-flutterwave would you raise a new issue with some more details and I'll look into this? 🙏 I take it you probably have not customised your Node version on Netlify? |
@danielroe That's correct, using Netlify's default setup Should I create the new issue here? |
@ackushiw-flutterwave Yes, thank you 😊 |
@Kematia Thanks, that worked! |
@Kematia thanks, that worked for me too |
… tests. Added in the useStatus() composable with associated usage example and tests. Changed the TSDoc defaults for { alt, az } in UseStatusResponse interface to reference Infinity. Includes upgrading @vueuse/core dependency for a known dependency tree bugfix (Ref: vueuse/vue-demi#76).
I also had this issue when running in CircleCI. I therefore needed to update the node version during the post-install command and also run the build process there, rather than via the cypress orb build command. Ended up like so: - cypress/install:
post-install:
- run:
name: "Update node version & Build Nuxt"
command: |
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
nvm install v16
nvm alias default 16.14.2
npm run build |
I'm trying to use
@vueuse/core
with@nuxtjs/composition-api
in my Nuxt project.And I get a error message:
But
@vue/composition-api
have been install. Because@vue/composition-api
is also@nuxtjs/composition-api
's dependency.I have no idea how to fix it.
Here is reproduction link: codesandbox
Have any solution to fix this? Thank you!
The text was updated successfully, but these errors were encountered: