Skip to content

New Install required regenerator-runtime which is not in configuration or installation readme #61

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

Closed
4 tasks done
jaysonng opened this issue May 18, 2022 · 16 comments
Closed
4 tasks done
Labels

Comments

@jaysonng
Copy link

New Issue Checklist

Issue Description

Going through the installation instructions from the README file, I get an error

ReferenceError: regeneratorRuntime is not defined

Which can be solved by requiring regenerator-runtime.

A quick update to the readme file requiring and installing regenerator-runtime fixes this.

Steps to reproduce

New installation on a clean parse-server will produce this issue.

Actual Outcome

error ReferenceError: regeneratorRuntime is not defined

Expected Outcome

ReadMe should mention the requirement for regenerator-runtime for people not as tech savvy like I am.

Failing Test Case / Pull Request

Environment

  • API Mail Adapter version: 6.0.1
  • Parse Server version: 5.2.1

Logs

@parse-github-assistant
Copy link

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

@mtrezza
Copy link
Member

mtrezza commented May 18, 2022

Which version of the mail adapter are you using? There is no version 6.x.

Were you able to track down what exactly causes the error, or which part of the adapter requires that dependency?
What is the dependency called, what did you add to your package.json?

@jaysonng
Copy link
Author

jaysonng commented May 19, 2022

Which version of the mail adapter are you using? There is no version 6.x.

Were you able to track down what exactly causes the error, or which part of the adapter requires that dependency? What is the dependency called, what did you add to your package.json?

sorry, It's version 2.1.0

this is the exact error I get.

ReferenceError: regeneratorRuntime is not defined
    at /Users/jayson/Projects/heroku/node_modules/parse-server-api-mail-adapter/lib/ApiMailAdapter.js:155:56
    at /Users/jayson/Projects/heroku/node_modules/parse-server-api-mail-adapter/lib/ApiMailAdapter.js:192:6
 at Object.<anonymous> (/Users/jayson/Projects/heroku/node_modules/parse-server-api-mail-adapter/lib/ApiMailAdapter.js:778:2)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/jayson/Projects/heroku/node_modules/parse-server-api-mail-adapter/lib/index.js:26:46)

dependencies in package.json

    "parse-server-api-mail-adapter": "^2.1.0",
    "regenerator-runtime": "^0.13.9",

I hope that helps. I didn't look into ApiMailAdapter.js yet as installing the regenaratorRuntime in package.json and requiring it in my app.js worked for me.

@mtrezza
Copy link
Member

mtrezza commented May 19, 2022

It seems that the polyfill that babel generated requires runtime, which Node version did you run this on?
Not sure I would add runtime like that, you probably don't know which version babel expected, so you may run into issues.

Maybe helpful for further investigation: https://stackoverflow.com/a/56754212/1870795

@jaysonng
Copy link
Author

jaysonng commented May 20, 2022

It seems that the polyfill that babel generated requires runtime, which Node version did you run this on? Not sure I would add runtime like that, you probably don't know which version babel expected, so you may run into issues.

Maybe helpful for further investigation: https://stackoverflow.com/a/56754212/1870795

i have v16.15.0 running.

So you don't encounter this problem with a new install on your end @mtrezza ?

@mtrezza
Copy link
Member

mtrezza commented Jan 24, 2023

We have a CI that tests with Node 16 and tests pass. Do you still see this issue in the latest version?

@penchef
Copy link

penchef commented Apr 27, 2023

I just ran into this issue here:

Solution/Workaround

yarn add regenerator-runtime

in index.ts (or where ever):
import 'regenerator-runtime';

@mtrezza
Copy link
Member

mtrezza commented Apr 27, 2023

@penchef Which Node version are you using?

It's not clear at this point what requires regeneratorRuntime, it would be great to get some more info.

@penchef
Copy link

penchef commented Apr 27, 2023

maybe this helps:

I only ran into this when I was running tests. This is the stack trace of the error:

 ReferenceError: regeneratorRuntime is not defined

  › node_modules/parse-server-api-mail-adapter/lib/ApiMailAdapter.js:155:56
  › node_modules/parse-server-api-mail-adapter/lib/ApiMailAdapter.js:192:6
  › Object.<anonymous> (node_modules/parse-server-api-mail-adapter/lib/ApiMailAdapter.js:778:2)
  › require.extensions.<computed> (node_modules/ts-node/src/index.ts:1286:43)

Node: v18.14.2
"parse": "4.0.1",
"parse-server": "6.0.0",
"parse-server-api-mail-adapter": "^2.2.0",
"ts-node": "^10.0.0",
"ts-node-dev": "^1.1.8",
"typescript": "^4.6.3"

@mtrezza
Copy link
Member

mtrezza commented Apr 27, 2023

What do you see at node_modules/parse-server-api-mail-adapter/lib/ApiMailAdapter.js:155:56?

@jaysonng
Copy link
Author

jaysonng commented May 1, 2023

We have a CI that tests with Node 16 and tests pass. Do you still see this issue in the latest version?

I have just commented out the regeneratorRuntime dependency in my package.json and so far it seems to be working fine.

@MikelCalvo
Copy link

MikelCalvo commented Jul 11, 2024

Hi,
After updating the parse server to 7.2.0 I'm getting this error too.
Here is the full error log:

/parse-server-api-mail-adapter/lib/ApiMailAdapter.js:133
      var _sendMail2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(_ref4) {
                                                       ^

ReferenceError: regeneratorRuntime is not defined
    at /parse-server-api-mail-adapter/lib/ApiMailAdapter.js:133:56
    at /parse-server-api-mail-adapter/lib/ApiMailAdapter.js:166:6
    at Object.<anonymous> (/parse-server-api-mail-adapter/lib/ApiMailAdapter.js:675:2)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at require (node:internal/modules/helpers:130:18)
    at Object.<anonymous> (/parse-server-api-mail-adapter/lib/index.js:25:46)

Node.js v20.9.0

@mtrezza
Copy link
Member

mtrezza commented Jul 11, 2024

Maybe this: parcel-bundler/parcel#1762 (comment), or remove babel altogether from this repo.

@mtrezza
Copy link
Member

mtrezza commented Jul 12, 2024

Could you please try out version 4.0.0? It rebuilds the package-lock file, so maybe it fixed this issue.

@MikelCalvo
Copy link

Could you please try out version 4.0.0? It rebuilds the package-lock file, so maybe it fixed this issue.

Can confirm, 4.0.0 is working great, thanks!

@mtrezza mtrezza closed this as completed Jul 15, 2024
@mtrezza
Copy link
Member

mtrezza commented Jul 15, 2024

Closed via #94

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

No branches or pull requests

4 participants