Webpack will not resolve JQuery-UI Definitions - jquery-ui

I have the following code in my TS file...
require("jquery-ui/ui/widgets/datepicker.js");
require("angular-ui-date/dist/date.js");
When I run the code I get the following error...
Module not found: Error: Cannot resolve module 'jquery-ui/datepicker' in //code/my-app/node_modules/angular-ui-date/dist
# ./~/angular-ui-date/dist/date.js 3:66-97
So I ran tsd install jqueryui --save and then added the following to the same file as the require...
/// <reference path="../../../typings/jqueryui/jqueryui.d.ts" />
based on src/main/typescripts but I still get the same warning when running webpack

It seems to be a issue with latest version you are using. It has nothing to do with type definition. if you open angular-ui-date/dist/date.js you will find that it is requiring
require("jquery-ui/datepicker")
which does not exist
to workaround you could change it manually to require("jquery-ui/ui/widgets/datepicker") but that's a ugly solution i think.
There is also an issue on github and there is also suggestion for workaround
Please see the isse here

I added an alias to the resolve object in the webpack configuration file.
'resolve' : {
'alias' : {
'jquery-ui/datepicker' : 'jquery-ui/ui/widgets/datepicker'
},
},

Related

Twilio 'Header' import issue

When i installed latest twilio's version which is "twilio": "^4.7.2", and building the project (npm run build) the following error occurs,
node_modules/twilio/lib/base/BaseTwilio.d.ts:22:19 - error TS2304: Cannot find name 'Headers'.
22 headers?: Headers;
~~~~~~~
Found 1 error in node_modules/twilio/lib/base/BaseTwilio.d.ts:22
My node version : v16.18.1
Npm version : v8.19.2
I got the same issue once I installed the twilio npm package of the exact same version ^4.7.2. I'm assuming it's some typescript compilation issue. And there is a trick that you can use to make it work.
Add this in your tsconfig.json:
{
"compilerOptions": {
"skipLibCheck": true,
}
}
This will solve your issue, but don't consider it as a fix. It's rather workaround.
P.S. This will also speed up your overall typescript compilation process.

Gradle cannot find plugin

I have the following in my build.gradle of my Grails 3 project.
dependencies {
...
compile "org.grails.plugins:spring-security-core:3.0.3"
// The following line was the true cause of my problem
compile("org.grails.plugins:spring-security-oauth-google:0.3.1")
...
}
Now when I run Gradle I get this error:
Error Error initializing classpath: Could not find spring-security-core.zip (org.grails.plugins:spring-security-core:3.0.3).
Searched in the following locations:
https://repo.grails.org/grails/core/org/grails/plugins/spring-security-core/3.0.3/spring-security-core-3.0.3.zip (Use --stacktrace to see the full trace)
If I go to the specified path I do see the plugin but just as reported there is no zip file.
What am I doing wrong here?
The root for this problem I found in a little bit different place than expected.
I am working on upgrading a Grails 2.5 project to Grails 3 and I had lead myself on a wrong track. I needed to include spring-security-oauth-google and when it did not work as expected I also included spring-security-core which then derailed me.
The cause of this problem is dependencies being loaded from dependencies I have in my own project. In order to avoid loading those dependencies - called transitive dependencies - the following has to be done:
plugins {
compile "org.grails.plugins:spring-security-core:3.0.3"
compile("org.grails.plugins:spring-security-oauth-google:0.3.1") {
exclude group: 'org.grails.plugins', module: 'spring-security-core'
}
}
This will load the spring-security-core 3.0.3 correctly ignoring the dependency from spring-security-oauth-google.

Grails 3 scaffolding issue

I'm trying to port my project from Grails 2.4 to 3.0. Nothing fancy: 12 Domains, 13 Controllers and a service.
Everything works fine, except when I try to include the Scaffolding plugin. I literally follow the manual here, but the syntax must be wrong. Adding the plugin line as specified:
plugins {
…
compile ":scaffolding:2.0.0"
…
}
leads to this:
BUILD FAILED
Total time: 1.559 secs
| Error Error initializing classpath: startup failed:
build file 'E:\GrailsIdeaProjects\HcaServer\build.gradle': 17: only id(String) method calls allowed in plugins {} script block
See http://gradle.org/docs/2.3/userguide/plugins.html#sec:plugins_block for information on the plugins {} block
# line 17, column 5.
compile ":scaffolding:2.0.0"
^
1 error
(Use --stacktrace to see the full trace)
Somebody knows the right syntax to include the Scaffolding plugin in Grails 3?
EDIT: Thanks to Casey for pointing me in the right direction: Scaffolding plugin is actually already included in default build.gradle. Anyway, i still get a webpage like this on every controller:
Error: Page Not Found (404)
Path: /*controllerName*/index
I've been using the same syntax as per the manual, declaring a static scaffold = true on each controller. Why do I get a 404 page then? I do have index.gsp, error.gsp and notFound.gsp in my views folder.
It looks like that documentation hasn't been updated for Grails 3.0 yet. Your build.gradle file should have a dependencies block, where you can specify the dependency:
dependencies {
// ...
runtime "org.grails.plugins:scaffolding"
}
You can also see this by creating a new app using Grails 3.0 and checking out the default build.gradle file.
After researching for a while, turns out dynamic scaffolding hasn't made it yet into Grails 3:
https://groups.google.com/forum/m/#!topic/grails-dev-discuss/6R2YaF96Uts
Try this, It works for me.
dependencies {
compile "org.grails.plugins:scaffolding"
}
I am using grails 3.09.

grails ui plugin not working with grails 2.1.0

I wanted to test some of the features like expandablePannels etc before putting into another project, so I created a new project with a CRUD just so I can use grails ui
I am using Intellij 11, so I installed the plugin and was responded with the following error:
Error Failed to resolve dependencies (Set log level to 'warn' in BuildConfig.groovy for more information):
- org.grails.plugins:yui:[2.6.0,)
IDEA hook: Grails not found!
| Error java.lang.NullPointerException
| Error at org.jetbrains.groovy.grails.rt.Agent$2.run(Agent.java:99)
| Error at java.lang.Thread.run(Thread.java:680)
Anyone else having issues using this plugin ?
Yet easier:
Edit BuildConfig.groovy and change the lines of the plugin dependency by these:
compile ":yui:2.8.2.1"
compile (":grails-ui:1.2.3") {
excludes 'yui'
}
Just in case it's useful to you.
I ran into same problem while upgrading my app from grails 1.3.7 to 2.1.0. yui is a dependency for grails-ui plugin (as grails-ui needs bubbling, and bubbling needs yui :-/) This is what I did :
Goto .grails/ivy-cache/org.grails.plugin/grails-ui folder
Open the file ivy-(version).xml (ivy-1.2.3.xml)
Look for this line : <dependency org="org.grails.plugins" name="yui" rev="**[2.6.0,)**" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)">
Replace [2.6.0,) with 2.8.2, so final line will look like this : <dependency org="org.grails.plugins" name="yui" rev="2.8.2" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)">
grails clean and grails compile
After this, this error was gone for good.
Hope this helps.
UPDATE :
Thanks to predicador37 ; Much cleaner & groovy-way of doing this - Put this under plugins in BuildConfig.groovy :
compile ":yui:2.8.2.1"
compile (":grails-ui:1.2.3") {
excludes 'yui'
}

Trouble including external jar required for an import in a src/java/{somename}.java in a grails-app( grails2.0)

I need a DHTMLXCONNECTOR.jar (a connector executable jar) in my grails app to use with my application otherwise i get errors like :
error compiling in javac connot find symbol : import com.dhtmlx.connector
please help !I tried grails install-dependencies dhtmlxconnector .. Is it, that i need to edit the buildconfig file ? like something similar to uncommenting runtime for mysql ?
(grails 2.0.1)
Add your dependency to the dependencies section of BuildConfig.groovy.
For example to add the dependency with
groupId: org.jsoup
artifactId: jsoup
version: 1.6.1
dependencies {
compile 'org.jsoup:jsoup:1.6.1'
}

Resources