SBT: Unable to resolved dependencies for date range picker - reactjs

I am trying to use this React based date range picker in my Play 2.5/Scala application:
https://github.com/onefinestay/react-daterange-picker
However, one of the dependencies cannot be found:
[warn] :: org.webjars.npm#calendar;0.2.1: not found
[warn] :: org.webjars.npm#calendar;[0.1.0,0.2): not found
...
[error] (common/*:update) sbt.ResolveException: unresolved dependency: org.webjars.npm#calendar;0.2.1: not found
[error] unresolved dependency: org.webjars.npm#calendar;[0.1.0,0.2): not found
There is no such package as "calendar" in webjars.org repository. Has the name changed? Any idea how I can make this datepicker build successfully ?

I found react-datepicker and react-bootstrap-daterangepicker.
libraryDependencies += "org.webjars.npm" % "react-datepicker" % "0.12.0"
or
libraryDependencies += "org.webjars.npm" % "react-bootstrap-daterangepicker" % "1.0.4"

Related

How could I solve Duplicate identifier 'DateType' Error on React/Typescript Building process

I am working with MUI lib, so that I have installed also the lib #mui/x-date-pickers, and I should install the lib #date-io/date-fns/ for my datepicker component work properly, but when I run yarn build I get this message error:
node_modules/#date-io/date-fns/type/index.d.ts:2:15 - error TS2300: Duplicate identifier 'DateType'.
2 export type DateType = Date;
~~~~~~~~
node_modules/#mui/x-date-pickers/node_modules/#date-io/date-fns/type/index.d.ts:2:15
2 export type DateType = Date;
~~~~~~~~
'DateType' was also declared here.
node_modules/#mui/x-date-pickers/node_modules/#date-io/date-fns/type/index.d.ts:2:15 - error TS2300: Duplicate identifier 'DateType'.
2 export type DateType = Date;
~~~~~~~~
node_modules/#date-io/date-fns/type/index.d.ts:2:15
2 export type DateType = Date;
~~~~~~~~
'DateType' was also declared here.
Found 2 errors in 2 files.
Errors Files
1 node_modules/#date-io/date-fns/type/index.d.ts:2
1 node_modules/#mui/x-date-pickers/node_modules/#date-io/date-fns/type/index.d.ts:2
Step by step for solving the problem:
yarn remove #mui/x-date-pickers (this will remove x-date-picker which has a problem of compatibility on its version 5.0 beta)
yarn add #mui/lab (if you cant find how to install it, you should put on your package json file, inside of dependencies this "#mui/lab": "^5.0.0-alpha.74"
remove your node_module folder then run yarn install
Swap your imports from this: import { DatePicker } from '#mui/x-date-pickers/DatePicker' \ To this -> import { DesktopDatePicker } from "#mui/lab";

Quill imports results in "missing dependencies" error

We're attempting to upgrade to angular 11 and are finding that Quill.import results in errors:
An error occurred during the build:
Error: The target entry-point "#project/project-pattern-lib" has missing dependencies:
- core/module
- blots/block/embed
- modules/clipboard
- delta
- formats/link
at TargetedEntryPointFinder.findEntryPoints (D:\Dev\Git_project\project\node_modules\#angular\compiler-cli\ngcc\src\entry_point_finder\targeted_entry_point_finder.js:40:23)
at D:\Dev\Git_project\project\node_modules\#angular\compiler-cli\ngcc\src\execution\analyze_entry_points.js:29:41
r.js:28:29)
at SyncLocker.lock (D:\Dev\Git_project\project\node_modules\#angular\compiler-cli\ngcc\src\locking\sync_locker.js:34:24)
at SingleProcessExecutorSync.execute (D:\Dev\Git_project\project\node_modules\#angular\compiler-cli\ngcc\src\execution\single_process_executor.js:57:27)
at Object.mainNgcc (D:\Dev\Git_project\project\node_modules\#angular\compiler-cli\ngcc\src\main.js:74:25)
at Object.process (D:\Dev\Git_project\project\node_modules\#angular\compiler-cli\ngcc\index.js:29:23)
at NgccProcessor.processModule (D:\Dev\Git_project\project\node_modules\#ngtools\webpack\src\ngcc_processor.js:163:16)
at D:\Dev\Git_project\project\node_modules\#ngtools\webpack\src\ivy\host.js:109:18
at D:\Dev\Git_project\project\node_modules\#ngtools\webpack\src\ivy\host.js:39:24
at Array.map (<anonymous>)
at Object.host.resolveModuleNames (D:\Dev\Git_project\project\node_modules\#ngtools\webpack\src\ivy\host.js:37:32)
at actualResolveModuleNamesWorker (D:\Dev\Git_project\project\node_modules\typescript\lib\typescript.js:102904:133)
at resolveModuleNamesWorker (D:\Dev\Git_project\project\node_modules\typescript\lib\typescript.js:103126:26)
at resolveModuleNamesReusingOldState (D:\Dev\Git_project\project\node_modules\typescript\lib\typescript.js:103200:24)
- core/module
- blots/block/embed
- modules/clipboard
- delta
- formats/link
See "C:\Users\Name\AppData\Local\Temp\ng-nIGMuY\angular-errors.log" for further details.
We can't seem to find anything in terms of a fix out there. All of these "missing dependencies" are referenced in the code like:
import Quill from "quill";
const BlockEmbed = Quill.import(
"blots/block/embed"
) as typeof Parchment.default.Embed;
Figured out there is a weird syntax issue here and the following solves it:
const blockPath = 'blots/block/embed';
const BlockEmbed = Quill.import(blockPath);
Don't know why this fixes it.

cakePHP:Tried running this code in cakePHP

C:\xampp\htdocs\my_app\bin>cake bake migration_snapshot Initial
PHP Warning: Module 'intl' already loaded in Unknown on line 0
Exception: Database driver Cake\Database\Driver\Mysql cannot be used due to a missing PHP extension or unmet dependency
In [C:\xampp\htdocs\my_app\vendor\cakephp\cakephp\src\Database\Connection.php, line 202]
2021-02-09 08:52:48 Error: [Cake\Database\Exception\MissingExtensionException] Database driver Cake\Database\Driver\Mysql cannot be used due to a missing PHP extension or unmet dependency in C:\xampp\htdocs\my_app\vendor\cakephp\cakephp\src\Database\Connection.php on line 202
Exception Attributes: array (
'driver' => 'Cake\\Database\\Driver\\Mysql',
)
Stack Trace:
- C:\xampp\htdocs\my_app\vendor\cakephp\cakephp\src\Database\Connection.php:142
- C:\xampp\htdocs\my_app\vendor\cakephp\cakephp\src\Datasource\ConnectionRegistry.php:90
- C:\xampp\htdocs\my_app\vendor\cakephp\cakephp\src\Core\ObjectRegistry.php:110
- C:\xampp\htdocs\my_app\vendor\cakephp\cakephp\src\Datasource\ConnectionManager.php:212
- C:\xampp\htdocs\my_app\vendor\cakephp\migrations\src\Command\BakeMigrationSnapshotCommand.php:122
- C:\xampp\htdocs\my_app\vendor\cakephp\migrations\src\Command\BakeMigrationSnapshotCommand.php:55
- C:\xampp\htdocs\my_app\vendor\cakephp\migrations\src\Command\BakeSimpleMigrationCommand.php:91
- C:\xampp\htdocs\my_app\vendor\cakephp\cakephp\src\Console\BaseCommand.php:179
- C:\xampp\htdocs\my_app\vendor\cakephp\cakephp\src\Console\CommandRunner.php:336
- C:\xampp\htdocs\my_app\vendor\cakephp\cakephp\src\Console\CommandRunner.php:172
- C:\xampp\htdocs\my_app\bin\cake.php:12
Please check if you have two different versions of php on your machine.
cake bake should read the php extensions from xamp's php version i.e C:\xampp\php.

compilation error when upgraded from ReactJS 15 + webpack 3.x TO ReactJS 16 + webpack 4

my app currently working fine with ReactJS 15 however I thought of upgrading it to ReactJS 16, currently I have an app which has both client and Server part.
many files are being referred in both client and server side, to upgrade ReactJS 16, I created a new project using create-react-app command , then I copied all my files/folders from old project to new project.
when I compiled, I faced lot of issues with respect to import / require style of including files , all the js files using module.exports = kind of are not working at all with ReactJS 16.
now I am getting following error, for which I am not getting any help in internet.
Failed to compile.
Error: Child compilation failed:
SyntaxError: Unexpected token )
- Function
- lodash.js:14866
[myapp]/[lodash]/lodash.js:14866:16
- lodash.js:473 apply
[myapp]/[lodash]/lodash.js:473:27
- lodash.js:15250
[myapp]/[lodash]/lodash.js:15250:16
- lodash.js:475 apply
[myapp]/[lodash]/lodash.js:475:27
- lodash.js:6569
[myapp]/[lodash]/lodash.js:6569:16
- lodash.js:14865 Function.template
[myapp]/[lodash]/lodash.js:14865:20
- SyntaxError: Unexpected token )
- compiler.js:141 childCompiler.runAsChild
[myapp]/[html-webpack-plugin]/lib/compiler.js:141:18
- Compiler.js:306 compile
[myapp]/[webpack]/lib/Compiler.js:306:11
- Compiler.js:630 hooks.afterCompile.callAsync.err
[myapp]/[webpack]/lib/Compiler.js:630:14
- Hook.js:154 AsyncSeriesHook.lazyCompileHook
[myapp]/[tapable]/lib/Hook.js:154:20
- Compiler.js:627 compilation.seal.err
[myapp]/[webpack]/lib/Compiler.js:627:30
- Hook.js:154 AsyncSeriesHook.lazyCompileHook
[myapp]/[tapable]/lib/Hook.js:154:20
- Compilation.js:1325 hooks.optimizeAssets.callAsync.err
[myapp]/[webpack]/lib/Compilation.js:1325:35
- Hook.js:154 AsyncSeriesHook.lazyCompileHook
[myapp]/[tapable]/lib/Hook.js:154:20
- Compilation.js:1316 hooks.optimizeChunkAssets.callAsync.err
[myapp]/[webpack]/lib/Compilation.js:1316:32
- Hook.js:154 AsyncSeriesHook.lazyCompileHook
[myapp]/[tapable]/lib/Hook.js:154:20
- Compilation.js:1311 hooks.additionalAssets.callAsync.err
[myapp]/[webpack]/lib/Compilation.js:1311:36

Angular errors "Module not found" when app is started

I'm starting out with hybrid mobile apps using Ionic. To start off I installed NodeJS, Angular, Ionic and Cordova on Windows 10. The problem I came across is when I created my Anuglar app and try to run it, it gives me a lot of errors and I don't know why if I haven't changed anything. I used the following commands.
# ng new [APP-NAME]
# cd [APP-NAME]
# ng serve
This returns all the following:
** NG Live Development Server is running on http://localhost:4200. **
94% asset optimizationwebpack: wait until bundle finished: /
Hash: dc480c594a2365ced8eb
Time: 1626ms
chunk {0} styles.bundle.map (styles) 28 bytes {2} [initial] [rendered]
chunk {1} main.bundle.js, main.bundle.map (main) 40 bytes [initial] [rendered]
chunk {2} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry] [rendered]
ERROR in multi main
Module not found: Error: Can't resolve 'webpack-dev-server/client?http://localhost:4200/' in 'C:\Users\Brian\Documents\Ionic Projects\github-repos'
# multi main
ERROR in multi styles
Module not found: Error: Can't resolve 'style-loader' in 'C:\Users\Brian\Documents\Ionic Projects\github-repos'
# multi styles
ERROR in multi main
Module not found: Error: Can't resolve '#ngtools/webpack' in 'C:\Users\Brian\Documents\Ionic Projects\github-repos'
# multi main
ERROR in Error: Child compilation failed:
Entry module not found: Error: Can't resolve 'raw-loader' in 'C:\Users\Brian\Documents\Ionic Projects\github-repos':
Error: Can't resolve 'raw-loader' in 'C:\Users\Brian\Documents\Ionic Projects\github-repos'
- compiler.js:76
[github-repos]/[angular-cli]/[html-webpack-plugin]/lib/compiler.js:76:16
- Compiler.js:279 Compiler.<anonymous>
[github-repos]/[angular-cli]/[webpack]/lib/Compiler.js:279:10
- Compiler.js:474
[github-repos]/[angular-cli]/[webpack]/lib/Compiler.js:474:13
- Tapable.js:102 next
[github-repos]/[angular-cli]/[webpack]/[tapable]/lib/Tapable.js:102:11
- CachePlugin.js:61 Compiler.<anonymous>
[github-repos]/[angular-cli]/[webpack]/lib/CachePlugin.js:61:4
- Tapable.js:106 Compiler.applyPluginsAsyncSeries
[github-repos]/[angular-cli]/[webpack]/[tapable]/lib/Tapable.js:106:13
- Compiler.js:471 Compiler.<anonymous>
[github-repos]/[angular-cli]/[webpack]/lib/Compiler.js:471:10
- Tapable.js:102 next
[github-repos]/[angular-cli]/[webpack]/[tapable]/lib/Tapable.js:102:11
- suppress-entry-chunks-webpack-plugin.js:28 Compilation.<anonymous>
[github-repos]/[angular-cli]/plugins/suppress-entry-chunks-webpack-plugin.js:28:17
- Tapable.js:106 Compilation.applyPluginsAsyncSeries
[github-repos]/[angular-cli]/[webpack]/[tapable]/lib/Tapable.js:106:13
- Compilation.js:626 Compilation.<anonymous>
[github-repos]/[angular-cli]/[webpack]/lib/Compilation.js:626:18
- Tapable.js:95 Compilation.applyPluginsAsyncSeries
[github-repos]/[angular-cli]/[webpack]/[tapable]/lib/Tapable.js:95:46
- Compilation.js:617 Compilation.<anonymous>
[github-repos]/[angular-cli]/[webpack]/lib/Compilation.js:617:10
- Tapable.js:95 Compilation.applyPluginsAsyncSeries
[github-repos]/[angular-cli]/[webpack]/[tapable]/lib/Tapable.js:95:46
- Compilation.js:612 Compilation.<anonymous>
[github-repos]/[angular-cli]/[webpack]/lib/Compilation.js:612:9
- Tapable.js:95 Compilation.applyPluginsAsyncSeries
[github-repos]/[angular-cli]/[webpack]/[tapable]/lib/Tapable.js:95:46
- Compilation.js:608 Compilation.<anonymous>
[github-repos]/[angular-cli]/[webpack]/lib/Compilation.js:608:8
- Tapable.js:95 Compilation.applyPluginsAsyncSeries
[github-repos]/[angular-cli]/[webpack]/[tapable]/lib/Tapable.js:95:46
- Compilation.js:554 Compilation.seal
[github-repos]/[angular-cli]/[webpack]/lib/Compilation.js:554:7
- Compiler.js:468 Compiler.<anonymous>
[github-repos]/[angular-cli]/[webpack]/lib/Compiler.js:468:16
- Tapable.js:189
[github-repos]/[angular-cli]/[webpack]/[tapable]/lib/Tapable.js:189:11
- Compilation.js:452 Compilation.<anonymous>
[github-repos]/[angular-cli]/[webpack]/lib/Compilation.js:452:10
- Compilation.js:347 Compilation.errorAndCallback
[github-repos]/[angular-cli]/[webpack]/lib/Compilation.js:347:3
- Compilation.js:364 Compilation.<anonymous>
[github-repos]/[angular-cli]/[webpack]/lib/Compilation.js:364:11
- NormalModuleFactory.js:40 onDoneResolving
[github-repos]/[angular-cli]/[webpack]/lib/NormalModuleFactory.js:40:20
- NormalModuleFactory.js:159
[github-repos]/[angular-cli]/[webpack]/lib/NormalModuleFactory.js:159:21
- async.js:726
[github-repos]/[angular-cli]/[webpack]/[async]/lib/async.js:726:13
- async.js:52
[github-repos]/[angular-cli]/[webpack]/[async]/lib/async.js:52:16
- async.js:241 done
[github-repos]/[angular-cli]/[webpack]/[async]/lib/async.js:241:17
- async.js:44
[github-repos]/[angular-cli]/[webpack]/[async]/lib/async.js:44:16
- async.js:723
[github-repos]/[angular-cli]/[webpack]/[async]/lib/async.js:723:17
- async.js:167
[github-repos]/[angular-cli]/[webpack]/[async]/lib/async.js:167:37
- async.js:52
[github-repos]/[angular-cli]/[webpack]/[async]/lib/async.js:52:16
- async.js:361
[github-repos]/[angular-cli]/[webpack]/[async]/lib/async.js:361:13
- async.js:52
[github-repos]/[angular-cli]/[webpack]/[async]/lib/async.js:52:16
- async.js:241 done
[github-repos]/[angular-cli]/[webpack]/[async]/lib/async.js:241:17
- async.js:44
[github-repos]/[angular-cli]/[webpack]/[async]/lib/async.js:44:16
- async.js:358
[github-repos]/[angular-cli]/[webpack]/[async]/lib/async.js:358:17
- NormalModuleFactory.js:216
[github-repos]/[angular-cli]/[webpack]/lib/NormalModuleFactory.js:216:19
- Resolver.js:70 onResolved
[github-repos]/[angular-cli]/[webpack]/[enhanced-resolve]/lib/Resolver.js:70:11
- createInnerCallback.js:31 loggingCallbackWrapper
[github-repos]/[angular-cli]/[webpack]/[enhanced-resolve]/lib/createInnerCallback.js:31:19
- Resolver.js:138 afterInnerCallback
[github-repos]/[angular-cli]/[webpack]/[enhanced-resolve]/lib/Resolver.js:138:10
- createInnerCallback.js:31 loggingCallbackWrapper
[github-repos]/[angular-cli]/[webpack]/[enhanced-resolve]/lib/createInnerCallback.js:31:19
- Tapable.js:145 Resolver.applyPluginsAsyncSeriesBailResult1
[github-repos]/[angular-cli]/[webpack]/[tapable]/lib/Tapable.js:145:46
- Resolver.js:125 innerCallback
[github-repos]/[angular-cli]/[webpack]/[enhanced-resolve]/lib/Resolver.js:125:19
- createInnerCallback.js:31 loggingCallbackWrapper
[github-repos]/[angular-cli]/[webpack]/[enhanced-resolve]/lib/createInnerCallback.js:31:19
- Tapable.js:247
[github-repos]/[angular-cli]/[webpack]/[tapable]/lib/Tapable.js:247:15
- UnsafeCachePlugin.js:39
[github-repos]/[angular-cli]/[webpack]/[enhanced-resolve]/lib/UnsafeCachePlugin.js:39:4
- createInnerCallback.js:31 loggingCallbackWrapper
[github-repos]/[angular-cli]/[webpack]/[enhanced-resolve]/lib/createInnerCallback.js:31:19
- Resolver.js:138 afterInnerCallback
[github-repos]/[angular-cli]/[webpack]/[enhanced-resolve]/lib/Resolver.js:138:10
- createInnerCallback.js:31 loggingCallbackWrapper
[github-repos]/[angular-cli]/[webpack]/[enhanced-resolve]/lib/createInnerCallback.js:31:19
webpack: bundle is now VALID.
Why is this is happening? How can I fix this?
My versions of the services are the following:
Node: v4.6.0
Angular: angular-cli: 1.0.0-beta.24
Ionic: 2.1.17
Cordova: 6.4.0
As gelliott181 suggested in the comments:
If you upgraded, be sure to "ng init" your app again and "d" for diff all files it asks you to overwrite before blindly OKing changes to your components and package.json.
This solved the same issue for me, but I was left with another error, which was:
ERROR in default is not an NgModule
Which is tracked HERE, and provides a workaround of downgrading to beta21, which solved the problem for me:
$ npm install --save-dev angular-cli#1.0.0-beta.21
It works with angular 2.4.1 for me.
I had hours of issues with this. Turned out I had the wrong verion of the angular-cli installed. ng new was spawning up an app that wouldn't build.
npm uninstall -g angular-cli
npm cache clean
npm install -g angular-cli#latest
Was what got me working. All thanks to this answer from #yoongkang-lim
ng serve does not work

Resources