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

VUE - jquery.ui was not found #1709

Closed
seydx opened this issue Apr 3, 2021 · 13 comments · Fixed by #1714
Closed

VUE - jquery.ui was not found #1709

seydx opened this issue Apr 3, 2021 · 13 comments · Fixed by #1714
Labels

Comments

@seydx
Copy link

seydx commented Apr 3, 2021

Subject of the issue

Hi all, I am trying to import "gridstack-dd-jqueryui" into my vue project as described in the readme, but I always get the error message that "jquery.ui" could not be found. What am I doing wrong?

Note:

With gridstack-dd-nativeeverything works, but i need the mobile touch support.

Your environment

OS: macOS v10.15.7
Gridstack version: v4.0.3
Browser: Google Chrome v89.0.4389.90
vue: v2.6.11

Bildschirmfoto 2021-04-03 um 15 39 08

Steps to reproduce

import "gridstack/dist/gridstack.min.css";
import { GridStack } from "gridstack";
import "gridstack/dist/jq/gridstack-dd-jqueryui";

Expected behavior

Should find jquery.ui

Actual behavior

Bildschirmfoto 2021-04-03 um 15 26 31

@Justin99b
Copy link

Same here
I tried to fix it but did not work
using Vue 3.x

@seydx
Copy link
Author

seydx commented Apr 3, 2021

Same here
I tried to fix it but did not work
using Vue 3.x

Which version? and how do u added it to your project?

@Justin99b
Copy link

Justin99b commented Apr 3, 2021

I am using Vue CLI
vue 3.0.11
i used yarn add gridstack to add it to my project
tried everything on google but i guess im to stupid to fix it.

@seydx
Copy link
Author

seydx commented Apr 3, 2021

I am using Vue CLI
vue 3.0.9
i used yarn add gridstack to add it to my project
tried everything on google but i guess im to stupid to fix it.

nvm, with following code it works also with latest version

import "gridstack/dist/gridstack.min.css";
import GridStack from "gridstack/dist/gridstack-jq.js";

@Justin99b
Copy link

src/components/StorageContainer.vue:13:23
TS7016: Could not find a declaration file for module 'gridstack/dist/gridstack-jq.js'. 'c:/Users/Justin/Desktop/FiveM/BetterDevelopment/Neuer Ordner/test/node_modules/gridstack/dist/gridstack-jq.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/gridstack` if it exists or add a new declaration (.d.ts) file containing `declare module 'gridstack/dist/gridstack-jq.js';`
    11 | <script lang="ts">
    12 | import {Options, Vue} from 'vue-class-component';
  > 13 | import GridStack from "gridstack/dist/gridstack-jq.js";
       |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    14 | import {StorageContainer} from "@/classes/StorageContainer";
    15 | import GridStackItemComponent from "@/components/GridStackItem.vue";
    16 |

Weird i only get this error

@adumesny
Copy link
Member

adumesny commented Apr 4, 2021

Update: I was in the wrong mood last night when I saw this. I see the doc (which I pasted below) mentions this... never mind, I'll take a look.

Also there are Vue 3 examples if you didn't see them.

@Justin99b
Copy link

I actually have this issue even tho i did it like in the documentation

Failed to compile.

./node_modules/gridstack/dist/jq/jquery.ui.touch-punch.js
Module not found: Error: Can't resolve 'jquery.ui' in 'c:\Users\Justin\Desktop\FiveM\BetterDevelopment\Neuer Ordner\test\node_modules\gridstack\dist\jq'

image

@adumesny adumesny reopened this Apr 4, 2021
@Justin99b
Copy link

Justin99b commented Apr 5, 2021

Update: I was in the wrong mood last night when I saw this. I see the doc (which I pasted below) mentions this... never mind, I'll take a look.

Also there are Vue 3 examples if you didn't see them.

We all have those kind of days no worries :)

Yes i saw the Vue3 Examples in Javascript

The only problem is that we cant import the Typescript Gridstack lib because of the mentioned error

note1: I deleted my previous answeres to keep it clean!
note2: I think you forgot to change the tags

@adumesny
Copy link
Member

adumesny commented Apr 5, 2021

@Justin99b index-jq.d.ts contains what you need, but I need to change filenames...

Also could you guys post a reproduceable folder for me to test ? my Angular app uses h5 (which as you mention works) and not sure it would compile the same way (can't recall if I tried the JQ or not).

adumesny added a commit to adumesny/gridstack.js that referenced this issue Apr 5, 2021
* export symbols .d.ts for `gridstack-h5.js | gridstack-jq.js | gridstack-static.js`
* renamed the index.* files so we get proper .d.ts files
* part of gridstack#1709
@adumesny adumesny mentioned this issue Apr 5, 2021
3 tasks
@Justin99b
Copy link

I Actually need it yes

Im using Gridstack for an Inventory system for FIveM (GTA V Multiplayer)

And They use CEF (Chromium Embedded Framework) which does not support HTML5 Drag & Drop

Therefore its pretty important to use the JQ Variant

@adumesny
Copy link
Member

adumesny commented Apr 6, 2021

I'm finding the html5 drag&drop less than idea, especially implemented quite differently on mac Safari... so I've been starting a new mouse only (and mobile pointer which is same) events instead. But that still a lot of work left.

@Justin99b
Copy link

Justin99b commented Apr 6, 2021

Here is an example

Quickly created with vue cli

I did not add a working gridstack

but its enough to reproduce
Execute in this order

1 yarn download dependencies
2 yarn serve start the webserver
3. http://localhost:8080
You should now see the error in the console and on the website

image

reproduce.zip

adumesny added a commit to adumesny/gridstack.js that referenced this issue Apr 6, 2021
* fix gridstack#1709
also fix gridstack#1306 I believe.
* correct info in Readme for using JQ version and ES6 (tested in Angular app)
* changed .ts to include jquery by name instead of location.
@adumesny adumesny mentioned this issue Apr 6, 2021
3 tasks
@adumesny
Copy link
Member

adumesny commented Apr 6, 2021

the doc include has been updated with info and I have verified that it works on my angular app (v4 and V3) with webpack include directives.

  alias: {
    'jquery': 'gridstack/dist/jq/jquery.js',
    'jquery-ui': 'gridstack/dist/jq/jquery-ui.js',
    'jquery.ui': 'gridstack/dist/jq/jquery-ui.js',
    'jquery.ui.touch-punch': 'gridstack/dist/jq/jquery.ui.touch-punch.js',
  },

don't forget to contribute if you find this lib useful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants