LouisBrunner / LouisBrunner/dnd-multi-backend

Drag-n-drop does not work with vite production builds, but does work in dev builds

Open
#324 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
211
Forks
36
Avg merge
1d 15h
Merged PRs (30d)
3

Description

This is happening in a real project for me. I stripped it down to demonstrate a minimal example: https://github.com/vezaynk/dnd-vite-issue-demo

## Description:

React-dnd with multiple back-ends does not function when a production build is made, but _does_ work in dev builds.

## Errors, logs, etc

The application renders and is otherwise interactive (aside from the issue described here). There are no errors/warnings/etc in the console.

## Platforms affected:

I have limited devices to test on. I have only tested and had this happen on iOS.

## Reproduction steps:

1. Install dependencies: `npm i`
2. Run dev build `npm run dev -- --host`
3. Run production build `npm run build && npm run preview -- --host`
4. Access both pages on a mobile devices (iOS safari)

## Expected Results

Dragging the "Hello World!" text should generate a preview on both pages.

## Actual Results

Dragging the "Hello World!" text only works on the page running from `npm run dev`.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the linked minimal example and reproduce the behavior using `npm run dev -- --host` and `npm run build && npm run preview -- --host` on iOS Safari. Compare the drag preview in development and production builds; done means dragging “Hello World!” works in both pages without console errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript, vite
Domain
frontend, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.