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

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

Open
pabitra opened this issue Jan 20, 2022 · 3 comments
Open

Comments

@pabitra
Copy link

pabitra commented Jan 20, 2022

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
Copy link
Member

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
Copy link
Author

pabitra commented Feb 4, 2022

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

@wickstargazer
Copy link
Member

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

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

No branches or pull requests

2 participants