PrismarineJS / prismarine-physics

Provide the physics engine for minecraft entities
MIT License
35 stars 39 forks source link

fix webpack build error #95

Closed gabrielmar closed 1 year ago

gabrielmar commented 1 year ago

Fixing Webpack build error when lib/features is not found

ERROR in ./node_modules/prismarine-physics/index.js 4:17-42
Module not found: Error: Can't resolve './lib/features' in 'PATH\node_modules\prismarine-physics'
resolve './lib/features' in 'PATH\node_modules\prismarine-physics'
  using description file: PATH\node_modules\prismarine-physics\package.json (relative path: .)
    Field 'browser' doesn't contain a valid alias configuration
    using description file: PATH\node_modules\prismarine-physics\package.json (relative path: ./lib/features)
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        PATH\node_modules\prismarine-physics\lib\features doesn't exist
extremeheat commented 1 year ago

This file should eventually be moved to minecraft-data's features.json file. For your issue, a more appropriate fix would be to update the require() to have a .json suffix if webpack is looking for, instead of making this a JS file.