-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Uncaught TypeError: Cannot read properties of undefined (reading 'prototype') at dd-gridstack.js:369:23 #2039
Comments
you don't say what rev you are using, so the line number don't line up, but I assume the first one, and what you include. GridStack.prototype._setupAcceptWidget = ... https://github.com/gridstack/gridstack.js#extend-library |
Some files cannot be found due to a bug after Vite2.0 is built, |
same problem |
你用的是vite来构建嘛,我将我的vite2升级为vite3就没问题了,我想可能是vite的问题 |
是用vite2构建的,我更换了导入的地址后可以了。 // @ts-ignore
import GridStack from 'gridstack/dist/es5/gridstack-all'; |
这样也可以,不过升级下vite也可以,2的bug太多了 |
read the doc - https://github.com/gridstack/gridstack.js#include - wrong include way (gridstack-all.js is only packaged for html include). use import { GridStack } from 'gridstack'; |
This error is generated after referencing builds like this in VitE2 at GridStack ^6.0.1. |
and please write content in english as I cannot translate it. You need to provide a running example showing it is a lib issue as I don't have bandwidth to debug other people issues. |
I had the same problem. Locally everything works fine, but in production I had this ""Potentially unhandled rejection [3] TypeError: Cannot read properties of undefined (reading 'prototype')" error. |
ha thanks for the hint... I see those methods I extracted out to different file (from when I supported static smaller bundle) and could remove that now.. |
I have the same issue. When I use Vue 3 / Vite and build for production I get My guess is that something in the new method of importing fails in some way. When using the old way it worked in prod just fine. It's hard to troubleshoot since it only happens in the minified code but it consistently fails during SetupAcceptWidget. Using the Vite dev servers with gridstack works without issues. |
* fix gridstack#2039 * moved all the D7D gridstack code into the gridstack.ts file as I gave up on the idea to build s a smaller static only code and delay load the D&D (which is much much smaller now) as it was causing some build issues for some users...
fixed in next release |
An error is displayed after the VUE project is packaged
Uncaught TypeError: Cannot read properties of undefined (reading 'prototype') at dd-gridstack.js:139
The text was updated successfully, but these errors were encountered: