tailwind
tailwind copied to clipboard
add tailwind to nx angular with ionic
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",
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..
Have the same issue with @angular/cli version: 11.2.8. using nx. Node version 14.8.0
Same issue here. ng version: 12.0.4 node version: v14.16.1 @ngneat/tailwind: 7.0.3
The same sadness
same here
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

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.
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
Anyone find a solution to this? Still seeing this issue in latest nx ng setup
@okarim4259 https://github.com/ngneat/tailwind/issues/94#issuecomment-821761553
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