tailwind icon indicating copy to clipboard operation
tailwind copied to clipboard

add tailwind to nx angular with ionic

Open ToledoNicola opened this issue 4 years ago • 11 comments

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

after install dependencies for nx angular npm i -D @ngneat/tailwind tailwindcss postcss autoprefixer when i run this nx generate @ngneat/tailwind:nx-setup


✔ What project would you like to use? (skip to use default project) · webapp
✔ Would you like to enable Tailwind JIT (preview feature)? (y/N) · true
✔ Would you like to enable dark mode? · none
Property 'darkMode' does not match the schema. 'none' should be one of [object Object],[object Object],[object Object].
nicolatoledo@MacBook-Pro-Retina-di-Nicola unobravo % 

Expected behavior

setup tailwind

Minimal reproduction of the problem with instructions

For bug reports please provide the STEPS TO REPRODUCE and if possible a MINIMAL DEMO of the problem

What is the motivation / use case for changing the behavior?

Environment


Angular version: 11.2.9


Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: 12.6  
- Platform:  Mac 

Others:
    "@angular/cli": "11.2.8",
    "@nrwl/workspace": "12.0.0",


ToledoNicola avatar Apr 09 '21 14:04 ToledoNicola

I also have that bug without using Ionic. Can reproduce the bug on my repository for every 7.0.* version with or without JIT and with different darkMode choices. Seems to be a bug with the validation of the darkMode option..

scorsi avatar Apr 09 '21 20:04 scorsi

Have the same issue with @angular/cli version: 11.2.8. using nx. Node version 14.8.0

IrakliDevelop avatar Apr 10 '21 08:04 IrakliDevelop

Same issue here. ng version: 12.0.4 node version: v14.16.1 @ngneat/tailwind: 7.0.3

fvdavid avatar Apr 14 '21 05:04 fvdavid

The same sadness

culttm avatar Apr 15 '21 09:04 culttm

same here

akdotv avatar Apr 15 '21 14:04 akdotv

In my investigation, the issue seems to be present in the following conditions:

@nrwl/workspace >= 12
NxCLI = true

@ngneat/tailwind: 7.0.3 as it works in the setup below:

$ npx [email protected] sample2 --preset angular-nest --appName demo-forms --cli nx
$ yarn add -D @ngneat/tailwind tailwindcss postcss autoprefixer
$ nx generate @ngneat/tailwind:nx-setup

image

lhargil avatar Apr 17 '21 03:04 lhargil

Workaround before we get fix is by add darkMode option as command parameter:

npx nx generate @ngneat/tailwind:nx-setup --darkMode=media

Available options:

nx generate @ngneat/tailwind:nx-setup [project] [options,...]

Options:
  --project               The project name to add Tailwind
  --enableJit             Whether to enable JIT compilation in tailwind.config.js
  --darkMode              Whether to enable darkMode in tailwind.config.js (default: none)
  --plugins               undefined
  --dryRun                Runs through and reports activity without writing to disk.
  --skip-nx-cache         Skip the use of Nx cache.
  --help                  Show available options for project target.

atmosuwiryo avatar Apr 17 '21 04:04 atmosuwiryo

with latest deps, above solution not working

 npx nx generate @ngneat/tailwind:nx-setup --darkMode=media
✔ What project would you like to use? (skip to use default project) · 
✔ Would you like to enable Tailwind JIT (preview feature)? (y/N) · true
Warning: Fell back to using 'fs' to identify 32mM docs/introduction/playbook.md as deleted. Please open an issue at https://github.com/nrwl/nx so we can investigate.
Warning: Fell back to using 'fs' to identify 32mM package.json as deleted. Please open an issue at https://github.com/nrwl/nx so we can investigate.
Warning: Fell back to using 'fs' to identify 32mM yarn.lock as deleted. Please open an issue at https://github.com/nrwl/nx so we can investigate.
"NxSetup" schema is using the keyword "id" which its support is deprecated. Use "$id" for schema ID.
TypeError: Cannot convert undefined or null to object
    at Function.values (<anonymous>)
    at yeti/node_modules/@ngneat/tailwind/src/utils/normalize-options-nx.js:12:16
    at Array.find (<anonymous>)
    at getDefaultProjectFromGraph (yeti/node_modules/@ngneat/tailwind/src/utils/normalize-options-nx.js:10:39)
    at Object.normalizeOptionsNx (/yeti/node_modules/@ngneat/tailwind/src/utils/normalize-options-nx.js:18:21)
    at yeti/node_modules/@ngneat/tailwind/src/schematics/nx-setup/nx-setup.js:30:58
    at MergeMapSubscriber.project (yeti/node_modules/@angular-devkit/schematics/src/rules/call.js:75:24)
    at MergeMapSubscriber._tryNext (yeti/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/operators/mergeMap.js:67:27)
    at MergeMapSubscriber._next (yeti/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/operators/mergeMap.js:57:18)
    at MergeMapSubscriber.Subscriber.next (yeti/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/Subscriber.js:66:18)
Cannot convert undefined or null to object

xmlking avatar Jul 04 '21 21:07 xmlking

Anyone find a solution to this? Still seeing this issue in latest nx ng setup

okarim4259 avatar Sep 11 '21 06:09 okarim4259

@okarim4259 https://github.com/ngneat/tailwind/issues/94#issuecomment-821761553

scorsi avatar Sep 20 '21 09:09 scorsi

Solution to this error ?

Error: NOT SUPPORTED: keyword "id", use "$id" for schema ID at Object.code (D:\Repository\Neoplex\npRevenue\npRevenue\npRevenue\WebApp\neoplex\node_modules\ajv\dist\vocabularies\core\id.js:6:15) at keywordCode (D:\Repository\Neoplex\npRevenue\npRevenue\npRevenue\WebApp\neoplex\node_modules\ajv\dist\compile\validate\index.js:454:13) at D:\Repository\Neoplex\npRevenue\npRevenue\npRevenue\WebApp\neoplex\node_modules\ajv\dist\compile\validate\index.js:222:17 at CodeGen.code (D:\Repository\Neoplex\npRevenue\npRevenue\npRevenue\WebApp\neoplex\node_modules\ajv\dist\compile\codegen\index.js:439:13) at CodeGen.block (D:\Repository\Neoplex\npRevenue\npRevenue\npRevenue\WebApp\neoplex\node_modules\ajv\dist\compile\codegen\index.js:568:18) at iterateKeywords (D:\Repository\Neoplex\npRevenue\npRevenue\npRevenue\WebApp\neoplex\node_modules\ajv\dist\compile\validate\index.js:219:9) at groupKeywords (D:\Repository\Neoplex\npRevenue\npRevenue\npRevenue\WebApp\neoplex\node_modules\ajv\dist\compile\validate\index.js:208:13) at D:\Repository\Neoplex\npRevenue\npRevenue\npRevenue\WebApp\neoplex\node_modules\ajv\dist\compile\validate\index.js:192:13 at CodeGen.code (D:\Repository\Neoplex\npRevenue\npRevenue\npRevenue\WebApp\neoplex\node_modules\ajv\dist\compile\codegen\index.js:439:13) at CodeGen.block (D:\Repository\Neoplex\npRevenue\npRevenue\npRevenue\WebApp\neoplex\node_modules\ajv\dist\compile\codegen\index.js:568:18) NOT SUPPORTED: keyword "id", use "$id" for schema ID

binydev avatar Nov 07 '21 17:11 binydev