Skip to content

Imports such as HSDropdown are missing after v4.1.1 #745

@antero111

Description

@antero111

Hi,

I have been using in the past such import import { HSDropdown } from 'preline' for manually running autoinits and controlling HSOverlays. After updating to v4.1.1, it seems that they are not available anymore? Was this intentional change?

Uncaught (in promise) SyntaxError: The requested module 'http://127.0.0.1:5176/node_modules/.vite/deps/preline.js?v=a68d2303' doesn't provide an export named: 'HSDropdown'

Currently for example this snippet from docs won't work at all since one can't import the HSDropdown from 'preline'.
...

const dropdown = new HSDropdown(document.querySelector('#dropdown'));
const openBtn = document.querySelector('#open-btn');

openBtn.addEventListener('click', () => {
  dropdown.open();
});

Docs also say that "The HSDropdown object is contained within the global window object" but I get error: can't access property "autoInit", window.HSDropdown is undefined.

What makes me wonder that when changing all imports to refrerence the window.HSDropdown etc as said in the docks, then preline v4.0.1 works fine but 4.1.1 won't. I hope that the HSDropdown imports etc. are not discontinued since they provided handly methogd autocompletions.

Also there is no notice about any breaking changes in the changelog.

Any ideas if I am just understanding this incorrectly or do you have something wrong? Thanks in advance!

Vue 3.5.29, Vite 7.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions