sindresorhus / camelcase-keys

Convert object keys to camel case
MIT License
689 stars 92 forks source link

An issue of Cannot use import statement outside a module #94

Closed AlexSun98 closed 2 years ago

AlexSun98 commented 2 years ago

In my package.json file, I have below dependencies installed at a NestJS project. It was working fine until I upgraded NestJS version 7 to 8. Its probably something to do with ts | js transform stuff. Any clue?

  1. "@nestjs/axios": "^0.0.8",
  2. "@nestjs/common": "^8.4.7",
  3. "@nestjs/core": "^8.4.7",
  4. "@nestjs/passport": "^8.2.2",
  5. "@nestjs/platform-express": "^8.4.7",
  6. "@nestjs/swagger": "^5.2.1",
  7. "@nestjs/typeorm": "^8.1.4",
  8. "@nestjsx/crud": "^5.0.0-alpha.3",
  9. "@nestjsx/crud-typeorm": "^5.0.0-alpha.3",
  10. "@types/body-parser": "^1.19.2",
  11. "@types/json-merge-patch": "0.0.8",
  12. "body-parser": "^1.20.0",
  13. "camelcase-keys": "^8.0.1",
  14. "class-transformer": "^0.5.1",
  15. "class-validator": "^0.13.2",
  16. "dotenv": "^16.0.1",
  17. "express-async-errors": "^3.1.1",
  18. "json-merge-patch": "^1.0.2",
  19. "passport": "^0.6.0",
  20. "passport-http-bearer": "^1.0.1",
  21. "pg": "^8.7.3",
  22. "reflect-metadata": "^0.1.13",
  23. "swagger-ui-express": "^4.4.0",
  24. "typeorm": "^0.3.6",
  25. "winston": "^3.7.2"

Error Details `({"Object.":function(module,exports,require,dirname,filename,jest){import mapObject from 'map-obj';

SyntaxError: Cannot use import statement outside a module`

sindresorhus commented 2 years ago

https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c