flowaccount / nx-plugins

Nx plugins built by FlowAccount team, helps deploy systems to the cloud
115 stars 34 forks source link

[BUG] After creating monorepo blank workspace not able to create api #126

Open pabitra opened 2 years ago

pabitra commented 2 years ago

Describe the bug After creating monorepo blank workspace not able to create serverless lambda app I am getting below error

nx g @flowaccount/nx-serverless:api-serverless --name=myapi --provider=aws ✔ In which directory should the serverless api be generated? · test ✔ Are you using the latest nx version? (Y/n) · true ✔ Which region do you want to default your deployment to? · ap-southeast-1 TypeError: workspace_2.toFileName is not a function at normalizeOptions (/mnt/c/work/nxpoc/node_modules/@flowaccount/nx-serverless/src/schematics/api/api.js:168:26) at /mnt/c/work/nxpoc/node_modules/@flowaccount/nx-serverless/src/schematics/api/api.js:181:25 at Generator.next () at /mnt/c/work/nxpoc/node_modules/tslib/tslib.js:117:75 at new Promise () at Object.__awaiter (/mnt/c/work/nxpoc/node_modules/tslib/tslib.js:113:16) at apiGenerator (/mnt/c/work/nxpoc/node_modules/@flowaccount/nx-serverless/src/schematics/api/api.js:180:20) at /mnt/c/work/nxpoc/node_modules/@flowaccount/nx-serverless/node_modules/@nrwl/devkit/src/utils/invoke-nx-generator.js:53:30 at Generator.next () at /mnt/c/work/nxpoc/node_modules/tslib/tslib.js:117:75 workspace_2.toFileName is not a function

To Reproduce Steps to reproduce the behavior:

  1. I am using WSL ubuntu 20.
  2. I ran this command below
  3. npx create-nx-workspace monorepopoc
  4. npm install @flowaccount/nx-serverless --save-dev
  5. nx g @flowaccount/nx-serverless:api-serverless --name=myapi --provider=aws

Package.json { "name": "nxpoc", "version": "0.0.0", "license": "MIT", "scripts": { "start": "nx serve", "build": "nx build", "test": "nx test" }, "private": true, "dependencies": {}, "devDependencies": { "@flowaccount/nx-serverless": "^1.1.2", "@nrwl/cli": "13.4.6", "@nrwl/tao": "13.4.6", "@nrwl/workspace": "13.4.6", "@types/node": "16.11.7", "prettier": "^2.3.1", "typescript": "~4.4.3" } }

Expected behavior It should create a serverless lambda folder withhin the apps folder

Screenshots ✔ In which directory should the serverless api be generated? · apps ✔ Are you using the latest nx version? (Y/n) · true ✔ Which region do you want to default your deployment to? · ap-southeast-1 TypeError: workspace_2.toFileName is not a function at normalizeOptions (/mnt/c/work/nxpoc/node_modules/@flowaccount/nx-serverless/src/schematics/api/api.js:168:26) at /mnt/c/work/nxpoc/node_modules/@flowaccount/nx-serverless/src/schematics/api/api.js:181:25 at Generator.next () at /mnt/c/work/nxpoc/node_modules/tslib/tslib.js:117:75 at new Promise () at Object.__awaiter (/mnt/c/work/nxpoc/node_modules/tslib/tslib.js:113:16) at apiGenerator (/mnt/c/work/nxpoc/node_modules/@flowaccount/nx-serverless/src/schematics/api/api.js:180:20) at /mnt/c/work/nxpoc/node_modules/@flowaccount/nx-serverless/node_modules/@nrwl/devkit/src/utils/invoke-nx-generator.js:53:30 at Generator.next () at /mnt/c/work/nxpoc/node_modules/tslib/tslib.js:117:75 workspace_2.toFileName is not a function

wickstargazer commented 2 years ago

Hey so this is an incompatible issue with nx 13

We have an issue for it #123

Please follow that. If that is solved this will work! :)

pabitra commented 2 years ago

No I am trying just create a new monorepo to explore the new features

wickstargazer commented 2 years ago

No I am trying just create a new monorepo to explore the new features

yes and i am struggling a bit with migrating to 13. :) please be patience