Skip to content
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

Fail on Nuxt 3 RC9 #91

Closed
agracia-foticos opened this issue Sep 5, 2022 · 16 comments
Closed

Fail on Nuxt 3 RC9 #91

agracia-foticos opened this issue Sep 5, 2022 · 16 comments
Labels
bug Something isn't working

Comments

@agracia-foticos
Copy link

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

@agracia-foticos agracia-foticos added the bug Something isn't working label Sep 5, 2022
@agracia-foticos
Copy link
Author

Fails the call to const { result, search } = useAlgoliaSearch('XXXXXX')

@Baroshem
Copy link
Collaborator

Baroshem commented Sep 5, 2022

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?

@Lexpeartha
Copy link

@Baroshem there was a breaking change introduced in nuxt rc 9, check out nuxt/framework#7116

@ricky11
Copy link

ricky11 commented Sep 6, 2022

This the error from vite :
WARN Module FormKit is disabled due to incompatibility issues: 11:00:41

  • [nuxt] Nuxt version ^3.0.0 is required but currently using 3.0.0-rc.9

@podlebar
Copy link
Contributor

podlebar commented Sep 6, 2022

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.

@Baroshem
Copy link
Collaborator

Baroshem commented Sep 6, 2022

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.

@monkemedia
Copy link

Does anyone have a quick fix for this in the meantime?

@lukaszflorczak
Copy link

lukaszflorczak commented Sep 8, 2022

@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
     }
   },

@monkemedia
Copy link

@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.

@lukaszflorczak
Copy link

lukaszflorczak commented Sep 9, 2022

@monkemedia

  1. Complete the "Set-up" instruction. You have to add postinstall script in your package.json and of course install patch-package.
  2. Run again npm/yarn/pnpm install – the patch will be automatically applied after installation.

@monkemedia
Copy link

@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'

@monkemedia
Copy link

Fixed it by following this #84

@Baroshem
Copy link
Collaborator

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 :)

@lukaszflorczak
Copy link

lukaszflorczak commented Sep 21, 2022

In my project, everything works fine (tested on rc-11). Thank you!

@podlebar
Copy link
Contributor

works with rc9 to rc11.
i upgraded my project step by step and i had no issues.

@Baroshem
Copy link
Collaborator

Closing the issue then. Thanks for the input guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants