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

Node v14.0.0 : Accessing non-existent property '__esModule' of module exports inside circular dependency #33046

Closed
descholar-ceo opened this issue Apr 24, 2020 · 1 comment

Comments

@descholar-ceo
Copy link

  • Version: v14.0.0

  • Platform:
    Linux 5.3.0-42-generic # 34~18.04.1-Ubuntu SMP Fri Feb 28 13:42:26 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

What steps will reproduce the bug?

  1. Running sequelize migrations
  2. npx sequelize-cli db:migrate
  3. I set sequelize like this in this documentation

How often does it reproduce? Is there a required condition?

  1. It fails whenever I run the following command:
    i. npx sequelize-cli db:migrate
    ===>And even on TravisCI, it is failing

What is the expected behavior?

1. It should create tables in database, which is using PostgreSQL as dialect

What do you see instead?

I am getting the following warnings:

$ npx sequelize-cli db:migrate

Sequelize CLI [Node: 14.0.0, CLI: 5.5.1, ORM: 5.21.6]

(node:29382) Warning: Accessing non-existent property '__esModule' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:29382) Warning: Accessing non-existent property '__esModule' of module exports inside circular dependency
(node:29382) Warning: Accessing non-existent property '__esModule' of module exports inside circular dependency
(node:29382) Warning: Accessing non-existent property '__esModule' of module exports inside circular dependency
(node:29382) Warning: Accessing non-existent property '__esModule' of module exports inside circular dependency
(node:29382) Warning: Accessing non-existent property '__esModule' of module exports inside circular dependency
(node:29382) Warning: Accessing non-existent property '__esModule' of module exports inside circular dependency
(node:29382) Warning: Accessing non-existent property '__esModule' of module exports inside circular dependency
Loaded configuration file "src/database/config.cjs".
Using environment "development".
Done in 0.58s.

Additional information

  1. I read this issue hoping it might help, but it did not
  2. Running that same command with v13.2.0, it does not give any issue
  3. I ran this command npx cross-env NODE_OPTIONS="--trace-warnings" yarn run migrations and got this instead:
$ npx sequelize-cli db:migrate

Sequelize CLI [Node: 14.0.0, CLI: 5.5.1, ORM: 5.21.6]

(node:24483) Warning: Accessing non-existent property '__esModule' of module exports inside circular dependency
    at emitCircularRequireWarning (internal/modules/cjs/loader.js:814:11)
    at Object.get (internal/modules/cjs/loader.js:825:5)
    at _interopRequireDefault (/home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/config-helper.js:31:58)
    at Object.<anonymous> (/home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/config-helper.js:25:15)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
    at Module.load (internal/modules/cjs/loader.js:1034:32)
    at Function.Module._load (internal/modules/cjs/loader.js:923:14)
    at Module.require (internal/modules/cjs/loader.js:1074:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at /home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/index.js:16:52
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/index.js:15:112)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
    at Module.load (internal/modules/cjs/loader.js:1034:32)
(node:24483) Warning: Accessing non-existent property '__esModule' of module exports inside circular dependency
    at emitCircularRequireWarning (internal/modules/cjs/loader.js:814:11)
    at Object.get (internal/modules/cjs/loader.js:825:5)
    at _interopRequireDefault (/home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/init-helper.js:15:58)
    at Object.<anonymous> (/home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/init-helper.js:5:15)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
    at Module.load (internal/modules/cjs/loader.js:1034:32)
    at Function.Module._load (internal/modules/cjs/loader.js:923:14)
    at Module.require (internal/modules/cjs/loader.js:1074:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at /home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/index.js:16:52
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/index.js:15:112)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
    at Module.load (internal/modules/cjs/loader.js:1034:32)
(node:24483) Warning: Accessing non-existent property '__esModule' of module exports inside circular dependency
    at emitCircularRequireWarning (internal/modules/cjs/loader.js:814:11)
    at Object.get (internal/modules/cjs/loader.js:825:5)
    at _interopRequireDefault (/home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/migration-helper.js:11:58)
    at Object.<anonymous> (/home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/migration-helper.js:9:15)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
    at Module.load (internal/modules/cjs/loader.js:1034:32)
    at Function.Module._load (internal/modules/cjs/loader.js:923:14)
    at Module.require (internal/modules/cjs/loader.js:1074:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at /home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/index.js:16:52
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/index.js:15:112)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
    at Module.load (internal/modules/cjs/loader.js:1034:32)
(node:24483) Warning: Accessing non-existent property '__esModule' of module exports inside circular dependency
    at emitCircularRequireWarning (internal/modules/cjs/loader.js:814:11)
    at Object.get (internal/modules/cjs/loader.js:825:5)
    at _interopRequireDefault (/home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/model-helper.js:7:58)
    at Object.<anonymous> (/home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/model-helper.js:5:15)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
    at Module.load (internal/modules/cjs/loader.js:1034:32)
    at Function.Module._load (internal/modules/cjs/loader.js:923:14)
    at Module.require (internal/modules/cjs/loader.js:1074:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at /home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/index.js:16:52
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/index.js:15:112)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
    at Module.load (internal/modules/cjs/loader.js:1034:32)
    at Function.Module._load (internal/modules/cjs/loader.js:923:14)
    at Module.require (internal/modules/cjs/loader.js:1074:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/commands/init.js:7:16)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
(node:24483) Warning: Accessing non-existent property '__esModule' of module exports inside circular dependency
    at emitCircularRequireWarning (internal/modules/cjs/loader.js:814:11)
    at Object.get (internal/modules/cjs/loader.js:825:5)
    at _interopRequireDefault (/home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/template-helper.js:15:58)
    at Object.<anonymous> (/home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/template-helper.js:13:15)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
    at Module.load (internal/modules/cjs/loader.js:1034:32)
    at Function.Module._load (internal/modules/cjs/loader.js:923:14)
    at Module.require (internal/modules/cjs/loader.js:1074:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at /home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/index.js:16:52
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/index.js:15:112)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
    at Module.load (internal/modules/cjs/loader.js:1034:32)
    at Function.Module._load (internal/modules/cjs/loader.js:923:14)
    at Module.require (internal/modules/cjs/loader.js:1074:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/commands/init.js:7:16)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
(node:24483) Warning: Accessing non-existent property '__esModule' of module exports inside circular dependency
    at emitCircularRequireWarning (internal/modules/cjs/loader.js:814:11)
    at Object.get (internal/modules/cjs/loader.js:825:5)
    at _interopRequireDefault (/home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/umzug-helper.js:15:58)
    at Object.<anonymous> (/home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/umzug-helper.js:13:15)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
    at Module.load (internal/modules/cjs/loader.js:1034:32)
    at Function.Module._load (internal/modules/cjs/loader.js:923:14)
    at Module.require (internal/modules/cjs/loader.js:1074:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at /home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/index.js:16:52
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/index.js:15:112)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
    at Module.load (internal/modules/cjs/loader.js:1034:32)
    at Function.Module._load (internal/modules/cjs/loader.js:923:14)
    at Module.require (internal/modules/cjs/loader.js:1074:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/commands/init.js:7:16)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
(node:24483) Warning: Accessing non-existent property '__esModule' of module exports inside circular dependency
    at emitCircularRequireWarning (internal/modules/cjs/loader.js:814:11)
    at Object.get (internal/modules/cjs/loader.js:825:5)
    at _interopRequireDefault (/home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/version-helper.js:11:58)
    at Object.<anonymous> (/home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/version-helper.js:9:15)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
    at Module.load (internal/modules/cjs/loader.js:1034:32)
    at Function.Module._load (internal/modules/cjs/loader.js:923:14)
    at Module.require (internal/modules/cjs/loader.js:1074:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at /home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/index.js:16:52
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/index.js:15:112)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
    at Module.load (internal/modules/cjs/loader.js:1034:32)
    at Function.Module._load (internal/modules/cjs/loader.js:923:14)
    at Module.require (internal/modules/cjs/loader.js:1074:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/commands/init.js:7:16)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
(node:24483) Warning: Accessing non-existent property '__esModule' of module exports inside circular dependency
    at emitCircularRequireWarning (internal/modules/cjs/loader.js:814:11)
    at Object.get (internal/modules/cjs/loader.js:825:5)
    at _interopRequireDefault (/home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/view-helper.js:19:58)
    at Object.<anonymous> (/home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/view-helper.js:13:15)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
    at Module.load (internal/modules/cjs/loader.js:1034:32)
    at Function.Module._load (internal/modules/cjs/loader.js:923:14)
    at Module.require (internal/modules/cjs/loader.js:1074:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at /home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/index.js:16:52
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/helpers/index.js:15:112)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
    at Module.load (internal/modules/cjs/loader.js:1034:32)
    at Function.Module._load (internal/modules/cjs/loader.js:923:14)
    at Module.require (internal/modules/cjs/loader.js:1074:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/home/descholar/descholar/myprojects/2020projects/nezago/phone-history-store-backend/node_modules/sequelize-cli/lib/commands/init.js:7:16)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
Loaded configuration file "src/database/config.cjs".
Using environment "development".
Done in 0.77s.
addaleax added a commit to addaleax/node that referenced this issue Apr 24, 2020
Since this property access is performed by generated code, and not
used for accessing the actual exports of a module (and because
transpilers generally define it as the first key of `module.exports`
when it *is* present), it should be okay to allow it.

Refs: nodejs#29935
Fixes: nodejs#33046
@addaleax
Copy link
Member

Thanks for the report! #33048 should fix this.

BethGriggs pushed a commit that referenced this issue Apr 27, 2020
Since this property access is performed by generated code, and not
used for accessing the actual exports of a module (and because
transpilers generally define it as the first key of `module.exports`
when it *is* present), it should be okay to allow it.

Refs: #29935
Fixes: #33046

PR-URL: #33048
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
BethGriggs pushed a commit that referenced this issue Apr 28, 2020
Since this property access is performed by generated code, and not
used for accessing the actual exports of a module (and because
transpilers generally define it as the first key of `module.exports`
when it *is* present), it should be okay to allow it.

Refs: #29935
Fixes: #33046

PR-URL: #33048
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
BethGriggs pushed a commit that referenced this issue Apr 28, 2020
Since this property access is performed by generated code, and not
used for accessing the actual exports of a module (and because
transpilers generally define it as the first key of `module.exports`
when it *is* present), it should be okay to allow it.

Refs: #29935
Fixes: #33046

PR-URL: #33048
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
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

Successfully merging a pull request may close this issue.

2 participants