Alephbet/alephbet

_alephbet.default.LamedAdapter is not a constructor

Closed this issue · 5 comments

after releasing 0.23.0 in #45 and also merging the missing dist files again in #44, it seems like when I try to import alephbet, it now fails with this error. Version 0.22.2 works

I don't think it has anything to do with the changes on #45 (it works if I load the dist minified file), so more likely the additional dist files that got committed? but no clue

see https://codesandbox.io/s/2wux7

This is on purpose I mentioned it here that you have to import it now in this way

import AlephBet, {Experiment, Goal, LamedAdapter} from "alephbet";

Another option would be

import * as AlephBet from "alephbet";

If you want to still access the classes with an AlephBet prefix.

https://codesandbox.io/s/gifted-rosalind-cn73e?file=/src/index.js

The link you sent https://codesandbox.io/s/gifted-rosalind-cn73e?file=/src/index.js still shows an error for me

CleanShot 2021-01-10 at 12 59 26

And also it worked with 0.22.2 but not with 0.23.0 ...

What am I missing?

https://codesandbox.io/s/607bf ok, this seems to work. Somehow codesandbox doesn't always save things properly?

CleanShot 2021-01-10 at 13 06 41

Also, the README is a bit confusing, isn't it?

It says

import {Experiment, Goal} from "alephbet" # ES6 module syntax

and then

const button_color_experiment = new AlephBet.Experiment({
...

Yes, it is strange. It definitely had the correct import syntax for me. Somehow it didn't save it properly. And you are right, the Readme is confusing. We should change it.

Updated README 3823327