-
Notifications
You must be signed in to change notification settings - Fork 16
Chrome reported some library "is not defined" when using CDN #32
Comments
I see your error message says It might be because you imported it as |
I actually tried both cases, zTree and ztree, same result. I checked the ztree codes and find it doesn't modules.export , it just attaches itself to jQuery, |
Because ztree doesn't |
Oh! Yeah that would make sense, it's common for jQuery modules to just mutate the jQuery object instead. You should just use |
So is this the reason Chrome reported ztree "is not defined" in my case? If yes does this mean I can not use your plugin for ztree ? |
Another problem I found, not sure if they are related, is that when I import css in my vue code, e.g.
|
I’m not sure the answer to your first question because I haven’t used zTree, but I imagine you should just be able to use zTree without any imports at all. For your second question regarding the bootstrap css— once you have added it to the externals plugin configuration, do not import the css in your source files. It is already present. So just remove your import statement and it will not be bundled. |
Hi I want to use CDN for my production build. Although I can load jQuery (as your example shows), some library was reported "not define", e.g. I want to load ztree use CDN and I use like this
In my vue code
import zTree from 'ztree'
When I opened my page, Chrome reported: So what did I do wrong here ?
The external ztree only has codes
module.exports = ztree;
The text was updated successfully, but these errors were encountered: