brianzinn / react-babylonjs

React for Babylon 3D engine
https://brianzinn.github.io/react-babylonjs/
812 stars 102 forks source link

version:3.1.10 EcmaScript Module #243

Closed cjjkoko closed 1 year ago

cjjkoko commented 1 year ago

At new version, I got this issue:(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"').

https://github.com/brianzinn/react-babylonjs/blob/master/packages/react-babylonjs/src/ReactBabylonJSHostConfig.ts

I change

import {
  DiscreteEventPriority,
  ContinuousEventPriority,
  DefaultEventPriority,
} from 'react-reconciler/constants'

to

import {
  DiscreteEventPriority,
  ContinuousEventPriority,
  DefaultEventPriority,
} from 'react-reconciler/constants.js'

can resolve this issue

fliptrail commented 1 year ago

You can also do a separate npm i react-reconciler. It will update it to the latest version.

brianzinn commented 1 year ago

thanks @cjjkoko for reporting that and helping me work through these issues!! Hope it's working for you now 😄

cjjkoko commented 1 year ago

@brianzinn thanks