BrainJS / brain.js

🤖 GPU accelerated Neural networks in JavaScript for Browsers and Node.js
https://brain.js.org
MIT License
14.25k stars 1.06k forks source link

fix error cannot find module. #886

Closed binsarjr closed 1 year ago

binsarjr commented 1 year ago

fix #885

Description

fix eror cannot find module. that error because when bran.js set gpu.js as peer dependecies. its not installed in our path. but,in user

Motivation and Context

issue

How Has This Been Tested?

i only change external rollup setting

Screenshots (if appropriate):

image image

Types of changes

Author's Checklist:

Reviewer's Checklist:

robertleeplummerjr commented 1 year ago

The introduction of loading GPU.js that way was so that the browser version worked correctly. Does simply removing it fix everything?

binsarjr commented 1 year ago

The introduction of loading GPU.js that way was so that the browser version worked correctly. Does simply removing it fix everything?

for nodejs library yes. the problem is gpu.js as a peerDepedency. so, when user downlaoded gpu.js, it will create for user node_modules path not our pacakge. it make wrong path when we use require('brain.js')

but for browser rollup it will be needed.