Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

it doesn't work in browser #32

Open
sunq0001 opened this issue Sep 25, 2020 · 3 comments
Open

it doesn't work in browser #32

sunq0001 opened this issue Sep 25, 2020 · 3 comments

Comments

@sunq0001
Copy link

i tried import the module into browser by webpack4 as below
import { BehaviorTree, Sequence, Task, SUCCESS, FAILURE } from 'behaviortree'

once i want to check by console.log(BehaviorTree), console shows undefined.

when i tried this way
import { BehaviorTree, Sequence, Task, SUCCESS, FAILURE } from '../node_modules/behaviortree/dist/index.node'
it can work.

but when i tried
import { BehaviorTree, Sequence, Task, SUCCESS, FAILURE } from '../node_modules/behaviortree/dist/index'
it doesn't work.

it seems that this package can only be used in Node, but not applied for web.

@Calamari
Copy link
Owner

I am not quite sure how your setup looks like, but you most likely would need a precompilation step, like using Webpack. If that is the case I don't see a reason why it shouldn't work.

@alekop
Copy link

alekop commented Jun 5, 2022

I can't get this imported into a TypeScript+Webpack project... We need a .d.ts file.

@Calamari
Copy link
Owner

Calamari commented Jun 7, 2022

Hey @alekop . Please try the typescript branch, which will be the base for the next release. That should work, and if it does not, please tell me, what error you get, so we can resolve that together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants