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

Issue when used in nextjs project #88

Closed
Nitzahon opened this issue Mar 7, 2021 · 6 comments
Closed

Issue when used in nextjs project #88

Nitzahon opened this issue Mar 7, 2021 · 6 comments

Comments

@Nitzahon
Copy link

Nitzahon commented Mar 7, 2021

So the decision was made to move the site to nextjs to improve response time, and we've encountered the following error when trying to load a component that uses your package:

Server Error
ReferenceError: regeneratorRuntime is not defined

This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
<unknown>
file:///G:/Repositories/Biomarkerz/biosurveyfs/client/node_modules/react-speech-recognition/lib/RecognitionManager.js (168:61)
<unknown>
file:///G:/Repositories/Biomarkerz/biosurveyfs/client/node_modules/react-speech-recognition/lib/RecognitionManager.js (239:6)
Object.<anonymous>
file:///G:/Repositories/Biomarkerz/biosurveyfs/client/node_modules/react-speech-recognition/lib/RecognitionManager.js (334:2)

image

I'm hoping there is a simple fix for this. This package is fantastic and I loathe the thought of changing the implementation

@Nitzahon
Copy link
Author

Nitzahon commented Mar 7, 2021

easier to read:
[client] ReferenceError: regeneratorRuntime is not defined
[client] at G:\Repositories\Biomarkerz\biosurveyfs\client\node_modules\react-speech-recognition\lib\RecognitionManager.js:201:61
[client] at G:\Repositories\Biomarkerz\biosurveyfs\client\node_modules\react-speech-recognition\lib\RecognitionManager.js:272:6
[client] at Object. (G:\Repositories\Biomarkerz\biosurveyfs\client\node_modules\react-speech-recognition\lib\RecognitionManager.js:367:2)
[client] at Module._compile (internal/modules/cjs/loader.js:1015:30)
[client] at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
[client] at Module.load (internal/modules/cjs/loader.js:879:32)
[client] at Function.Module._load (internal/modules/cjs/loader.js:724:14)
[client] at Module.require (internal/modules/cjs/loader.js:903:19)
[client] at require (internal/modules/cjs/helpers.js:74:18)
[client] at Object. (G:\Repositories\Biomarkerz\biosurveyfs\client\node_modules\react-speech-recognition\lib\SpeechRecognition.js:16:50)
[client] at Module._compile (internal/modules/cjs/loader.js:1015:30)
[client] at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
[client] at Module.load (internal/modules/cjs/loader.js:879:32)
[client] at Function.Module._load (internal/modules/cjs/loader.js:724:14)
[client] at Module.require (internal/modules/cjs/loader.js:903:19)
[client] at require (internal/modules/cjs/helpers.js:74:18)

@JamesBrill
Copy link
Owner

Hi @Nitzahon Could you try the following:

  • npm i --save regenerator-runtime
  • Put this at the top of your _app.js file: import 'regenerator-runtime/runtime'

If this works, I'll add this to the README as this seems to be a recurring problem for NextJS users.

@Nitzahon
Copy link
Author

Nitzahon commented Mar 7, 2021

Legen....

@Nitzahon
Copy link
Author

Nitzahon commented Mar 7, 2021

Wait for it.....

@Nitzahon
Copy link
Author

Nitzahon commented Mar 7, 2021

DARY!

@Nitzahon Nitzahon closed this as completed Mar 7, 2021
@spiderpoul
Copy link

Hi @Nitzahon Could you try the following:

  • npm i --save regenerator-runtime
  • Put this at the top of your _app.js file: import 'regenerator-runtime/runtime'

If this works, I'll add this to the README as this seems to be a recurring problem for NextJS users.

Worked for gatsby as well. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants