Open kadlinobit opened 2 years ago
I'm currently facing this same bug. Subscribing.
Same here. Subscribing.
Having the exact same problem with a fresh Nuxt app.
@pi0 I reproduced the same error on a fresh nuxt project, would you have an idea where this could come from?
@kadlinobit I just pushed a fix on the dev
branch, would you be able to test the latest @nuxtjs/strapi-edge
to make sure the compatibility with bridge is fixed?
@benjamincanac Hi, sorry but I've abandoned Strapi in favor of another CMS and completely refactored my Nuxt project already. Any of you guys - @Zielgestalt , @Ennazk , @f0086 - fancies testing the new version?
@kadlinobit @benjamincanac thanks, the error is gone.
I'm still struggling with top-level 'await' is not allowed is script setup, so I can't really test fetching data. But this is a general problem for me not related with the module. But if somebody knows a solution for this, maybe we could add this to the documentation.
Thanks!
@Zielgestalt Have you try to use the nuxt3 composable useAsyncData ? Don't know if I well understand your problem but maybe it could resolve it.
useAsyncData is not available in bridge. My problem was that I can't use e.g. fetchUser like described here in the docs: https://strapi.nuxtjs.org/usage#fetchuser I get this error:
Module Error (from ./node_modules/unplugin-vue2-script-setup/node_modules/unplugin/dist/webpack/loaders/transform.js):
top-level await is not supported in Vue 2
But since I can use useStrapiUser() without await this isn't a problem anymore.
Version
@nuxtjs/strapi: @nuxtjs/strapi-edge@^1.0.0-27336403.27afa67 nuxt: @nuxt/bridge-edge@^3.0.0-27338323.1e98259
Reproduction Link
https://github.com/kadlinobit/djspot-fe/tree/nuxt-3-bridge (nuxt-3-bridge branch)
Steps to reproduce
What is Expected?
Nuxt server starts.
What is actually happening?
During build process, there is an error:
I have tried putting Strapi module both to nuxt modules (like with the previous version) and to build-modules (as stated in the new version docs), but none of them works.