Blank Admin Page: regeneratorRuntime is not defined (babel?)

@wakywayne saying you have v14 installed, you should set that as the default node version. otherwise, install that and remove v16

Same as someone posted above. I fixed it by upgrading the version to 4.10.12. Btw, 4.0.6 and 4.1.8 don’t work for me.
And if you directly upgrade from 4.0.0 to 4.1.1+. Don’t miss the following setting, this is only mentioned in v4.1.8 migration guide.

You have to set jwtSecret in config/plugin.js

Strapi no longer populates default values for the admin JWT in config/admin . Initial values are generated and stored in the .env file during project creation. Strapi no longer passes secrets to non-development environments, requiring users to set the secrets purposefully.

Still waiting for some offical solution from strapi team :grinning:

1 Like

Please could you share a screenshot or briefly explain how you set JWTSecret. Thank you

1 Like

if you are using Heroku to deploy your app, then set the environmental variable of jwt secret there.

I believe everything will work fine

As for the upgrades you only need to change the version number in your package.json file. you can find more details in the upgrade guide

but if you need to migrate then check out this documentation

Is this in regards when you are deploying your application, I believe that you need to set your Strapi URL ENV variable.

Check this article, here we use example where we deploy on Render. GitHub - derrickmehaffy/strapi-test-v4-render-deploy: Test deploying on render

Let me know if that helps. If you are having these issues when deploying, share you platform where you are deploying and your deployment setting to help us help you best.

I will also try to reproduce the error on the platform where you are trying to deploy.

I think it requires a new build

npm run build

Let me know if it helped.

Here is the complete solution I used with our Strapi 4.0.7 build/deploy. I should mention that we never saw the issue until we tried to deploy to an Azure stack. This took us about 2 weeks to solve from the myriad of solutions out there! Hope this helps someone!!!

./npm/strapi/packages/core/admin/package.json
(Add the following to the dependencies)
"regenerator-runtime": "^0.13.9",

./npm/strapi/packages/core/admin/admin/src/index.js
(Add the following to the top)
import "regenerator-runtime/runtime.js";

.babelrc
.npm/strapi/packages/utils/babel-plugin-switch-ee-ce/.babelrc
(Replace code found with the following)

{
    "presets": [
    ["@babel/preset-env",
      {
        "targets": {
          "node": "14"
       },
        useBuiltIns: 'usage'
      }
    ]
  ],
    "plugins": ["@babel/plugin-transform-runtime",
      {
        "absoluteRuntime": false,
        "helpers": true,
        "regenerator": true
      }
    ]
}

I have managed to solve the issue with following:

  • Update strapi version with plugins in package.json to 4.2.0
  • add apiToken: { salt: env("API_TOKEN_SALT"), }, to config/admin.js
  • add "users-permissions": { config: { jwtSecret: env("JWT_SECRET"), }, }, to config/plugins.js

@ keara_fallon Cannot thank you enough for this. The solution for me was not exactly the same but the gist of it was dead-on. FWIW for anyone else running into this, I am running Strapi Community Edition 4.1.1. The solution for me is below:

  1. First, locate the file To fix this, open the file ./node_modules/@strapi/admin/admin/src/index.js and add the following line at the top of the file: import 'regenerator-runtime/runtime';
  2. Then, in the terminal/cli, run yarn add regenerator-runtime. Then run yarn build then yarn develop to start the app.

Ideally you don’t want to modify the core files but that was the only way I could find to fix the issue. I will try to create a Pull Request in the Strapi github repo to submit the fix to the official repo.

I’ve updated my package.json from:

{
  "dependencies": {
    "@strapi/plugin-graphql": "4.1.5",
    "@strapi/plugin-i18n": "4.1.5",
    "@strapi/plugin-users-permissions": "4.1.5",
    "@strapi/strapi": "4.1.5",
    "pg": "^8.8.0",
    "pg-connection-string": "^2.5.0",
    "sqlite3": "5.0.2"
  },
  ...

to

{
  "dependencies": {
    "@strapi/plugin-graphql": "4.5.3",
    "@strapi/strapi": "4.5.3", 
    "@strapi/plugin-users-permissions": "4.5.3",
    "@strapi/plugin-i18n": "4.5.3",
    "better-sqlite3": "7.4.6",
    "pg": "^8.8.0",
    "pg-connection-string": "^2.5.0"
  },
  ...

And it worked!! Don’t be scared if you need to wait a couple of seconds for the admin panel to load!

this broke my machine, it literally went into an infinite loop, I had to reboot the machine.