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

Dynamic Code Evaluation error in next.js #6249

Open
1 task done
TariqSaiyad opened this issue Jun 24, 2024 · 1 comment
Open
1 task done

Dynamic Code Evaluation error in next.js #6249

TariqSaiyad opened this issue Jun 24, 2024 · 1 comment
Labels
triage Issues to be categorized by the team

Comments

@TariqSaiyad
Copy link

🐛 Current behavior

I'm currently using the <InstantSearchNext> component in next.js for search, but my app won't build due to a Dynamic Code Evaluation error. I've made sure that the component has "use client" at the top and that the route segment is set to force-dynamic as per the docs.

Some details below:

Dependencies:

"algoliasearch": "^4.23.3",
"next": "^14.2.4",
"react-instantsearch": "^7.11.2",
"react-instantsearch-nextjs": "^0.3.3"

Error:

Dynamic Code Evaluation (e. g. 'eval', 'new Function', 'WebAssembly.compile') not allowed in Edge Runtime 
Learn More: https://nextjs.org/docs/messages/edge-dynamic-code-evaluation

The error was caused by importing 'react-instantsearch/dist/es/index.js' in './components/search/complex-doc-search/complex-doc-search.tsx'.

🔍 Steps to reproduce

I cannot share the project code as it is a private repo.

Live reproduction

cannot reproduce

💭 Expected behavior

The search should run as expected, I'm not deploying to the edge runtime, only in the nodejs runtime.

Package version

react-instantsearch 7.11.2, react-instantsearch-nextjs 0.3.3, next 14.2.4

Operating system

No response

Browser

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@TariqSaiyad TariqSaiyad added the triage Issues to be categorized by the team label Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Issues to be categorized by the team
Projects
None yet
Development

No branches or pull requests

2 participants
@TariqSaiyad and others