Skip to content

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

@vezaynk

Description

@vezaynk

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions