Skip to content

Cannot use import statement outside a module #10013

Open
@pxue

Description

@pxue

Reproduction

  1. yarn add @react-three/cannon
  2. import { Physics } from "@react-three/cannon"

System Info

System:
    OS: macOS 14.4.1
    CPU: (8) arm64 Apple M3
    Memory: 152.11 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.20.2 - ~/.nvm/versions/node/v18.20.2/bin/node
    Yarn: 1.22.22 - /opt/homebrew/bin/yarn
    npm: 10.5.0 - ~/.nvm/versions/node/v18.20.2/bin/npm
    pnpm: 8.15.7 - /opt/homebrew/bin/pnpm
  Browsers:
    Chrome: 128.0.6613.138
    Safari: 17.4.1
  npmPackages:
    @remix-run/dev: ^2.12.0 => 2.12.0
    @remix-run/node: ^2.12.0 => 2.12.0
    @remix-run/react: ^2.12.0 => 2.12.0
    @remix-run/serve: ^2.12.0 => 2.12.0
    vite: ^5.1.0 => 5.4.4

Used Package Manager

yarn

Expected Behavior

Should not produce error.

Works fine with Vite standalone, example repo works fine here:

https://github.com/pmndrs/use-cannon/tree/master/packages/react-three-cannon-examples

Actual Behavior

Screenshot 2024-09-21 at 6 35 38 PM

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions