Closed agracia-foticos closed 2 years ago
Fails the call to const { result, search } = useAlgoliaSearch('XXXXXX')
Hey @agracia-foticos
I am currently on holidays without access to the computer so I wont be able to release a new version with a fix. I will do that later in september when I will be back.
Also, could you please paste the error here with more descriptive info?
@Baroshem there was a breaking change introduced in nuxt rc 9, check out nuxt/framework#7116
This the error from vite : WARN Module FormKit is disabled due to incompatibility issues: 11:00:41
^3.0.0
is required but currently using 3.0.0-rc.9
i deploy to Vercel and this is what i get:
ERROR [nuxt] [request error] [unhandled] [500] Directory import '/var/task/node_modules/vue-instantsearch/vue3/es' is not supported resolving ES modules imported from /var/task/chunks/app/server.mjs
i assume it's because of this:
autoImports:dirs hook is deprecated. Use addImportsDir() from @nuxt/kit or imports:dirs with nuxt>=3.0.0-rc.9.
Guys, thanks for explaining the issue. It seems that the nuxt core team released a breaking change in the nuxt kit. The fix should be relatively simple (replacing the hook) but I wont be able to release a fix version with it as I am currently on holidays. I will be back end of september and then I will release the new version to fix your issues.
Does anyone have a quick fix for this in the meantime?
@monkemedia Here is my patch. You can use patch-package and add the code below to patches/@nuxtjs+algolia+1.1.1.patch
file. It works for me.
diff --git a/node_modules/@nuxtjs/algolia/dist/module.json b/node_modules/@nuxtjs/algolia/dist/module.json
index 506aa8c..7b327a0 100644
--- a/node_modules/@nuxtjs/algolia/dist/module.json
+++ b/node_modules/@nuxtjs/algolia/dist/module.json
@@ -2,7 +2,7 @@
"name": "@nuxtjs/algolia",
"configKey": "algolia",
"compatibility": {
- "nuxt": "^3.0.0 || ^2.16.0",
+ "nuxt": "^3.0.0-rc.9 || ^2.16.0",
"bridge": true
},
"version": "1.1.1"
diff --git a/node_modules/@nuxtjs/algolia/dist/module.mjs b/node_modules/@nuxtjs/algolia/dist/module.mjs
index e37b246..13aba7d 100644
--- a/node_modules/@nuxtjs/algolia/dist/module.mjs
+++ b/node_modules/@nuxtjs/algolia/dist/module.mjs
@@ -90,7 +90,7 @@ const module = defineNuxtModule({
name: "@nuxtjs/algolia",
configKey: "algolia",
compatibility: {
- nuxt: "^3.0.0 || ^2.16.0",
+ nuxt: "^3.0.0-rc.9 || ^2.16.0",
bridge: true
}
},
@lukaszflorczak Once I make these changes, do I do anything else? I just re-ran npx nuxi dev
and am getting the following error: Cannot destructure property 'applicationId' of '__vite_ssr_import_0__.useRuntimeConfig(...).algolia' as it is undefined.
@monkemedia
postinstall
script in your package.json
and of course install patch-package
. npm/yarn/pnpm install
– the patch will be automatically applied after installation. @lukaszflorczak thank you for the instructions. I have never used patch package before. Seem to have done everything correctly and the patch has been installed, however, I am still getting the same error Cannot destructure property 'applicationId'
Fixed it by following this https://github.com/nuxt-community/algolia-module/issues/84
Guys, the new version has been released. You can verify now if it works correctly. I have tested it in several nuxt projects and it is working correctly :)
In my project, everything works fine (tested on rc-11
). Thank you!
works with rc9 to rc11. i upgraded my project step by step and i had no issues.
Closing the issue then. Thanks for the input guys!
Version
@nuxtjs/algolia: 1.1.0 nuxt: 3.0.0-rc.9
Reproduction Link
We have updated Nuxt to version 3 RC 9 and it has thrown us an error. Please update module to work with RC 9