bigskysoftware / bigskysoftware/htmx-extensions

path-deps: Cannot set properties of undefined (setting 'PathDeps')

Open
#168 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
284
Forks
88
PR merge metrics
No merged PRs in 30d

Description

I'm using Vite. In development mode it works fine. But somethings going wrong when budling.:

`Uncaught TypeError: Cannot set properties of undefined (setting 'PathDeps')`

The debug extension is working fine.

htmx.js
```
import htmx from 'htmx.org';
window.htmx = htmx;
```

main.js
```
import './htmx.js';
import 'htmx-ext-path-deps';
import "htmx-ext-debug";
import "htmx-ext-alpine-morph";
...
```

vite.config.js
```
plugins: [
inject({
htmx: 'htmx.org',
}),
...
```

Contributor guide

Open the contributing guide

Research direction

Read htmx.js, main.js, and vite.config.js together, then reproduce the production bundle with the shown imports and inject configuration. Trace where htmx-ext-path-deps assigns PathDeps and compare that with the available htmx object; done means the bundle no longer throws this error and the extension works in the bundled application.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, vite
Domain
build-system, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.