Skip to content

babel plugin throws ENOENT for filenames with query suffixes e.g. from vite #9575

Description

@NiGhTTraX

Description

Context: I'm using Storybook for React Native Web and I need to transpile a node_modules dependency that uses reanimated.

When running the worklets Babel plugin through vite, via @rollup/plugin-babel (or rolldown), it may receive filenames with querystrings, such as ?v=123. This will cause the plugin to throw ENOENT when it tries to read the file to generate source maps:

■  Vite Internal server error:
│  ./node_modules/.cache/storybook/10.3.6/1c3385a5d25e538d10b518b310c74d3ca2690b6aaffeadccd74da79736171f86/sb-vite/deps/heroui-native.js?v=b3c989f4:
│  [Worklets] Babel plugin exception: ENOENT: no such file or directory, open
│  './node_modules/.cache/storybook/10.3.6/1c3385a5d25e538d10b518b310c74d3ca2690b6aaffeadccd74da79736171f86/sb-vite/deps/heroui-native.js?v=b3c989f4'
│  Plugin: vite:react-babel

Steps to reproduce

  1. Clone this repository.
  2. pnpm install
  3. pnpm run storybook

Expected: Storybook runs without any errors.
Actual: ENOENT errors

Snack or a link to a repository

https://github.com/NiGhTTraX/sb-native-reanimated

Reanimated version

4.2.1

Worklets version

0.7.4

React Native version

0.83.6

Platforms

Web

JavaScript runtime

Hermes

Workflow

Expo Go

Architecture

New Architecture (Fabric renderer)

Reanimated feature flags

No

React Native release level

Stable

Build type

Debug app & dev bundle

Device

No response

Host machine

macOS

Device model

No response

Acknowledgements

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Platform: WebThis issue is specific to webRepro providedA reproduction with a snippet of code, snack or repo is provided

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions