Closed RafaelPlantard closed 7 years ago
NPM error? Not clear what you are asking for.
Closing until further details provided.
@gajus I'm trying to use Scream
+ Brim
with webpack into a Vue.JS system, but when I try to create an instance of Brim, using the following code:
import Scream from 'scream';
import Brim from 'brim';
/*...*/
const scream = Scream({
width: {
portrait: 320,
landscape: 568
}
});
const brim = Brim({
viewport: scream
});
package.json
:
"brim": "^1.0.11",
The brim instance has not been created because of this: https://github.com/gajus/brim/blob/809d68475504aa2482fadca1d90cb7620fb11bbd/src/brim.js#L19
For some reason the Scream
from NPM package is not same of gajus.Scream
instance.
Any idea of how to solve it?
Have you inspected the contents of the entry point of those scripts?, i.e. look at the package.json main value and what script that executes.
I have not touched Scream/ Brim in a long time.
Oh, I see. This line of code was from Brim.
https://github.com/gajus/brim/blob/809d68475504aa2482fadca1d90cb7620fb11bbd/src/brim.js#L19-L21
Yeah, this obviously does not make sense.
Looks like the only fix would be to add scream
as a dependency of Brim and check instanceof of the imported dependency.
Hey @gajus thanks for this update, but apparently isn't working:
I run it before: npm update
:
"brim": "^1.0.12",
Can you try to look into the code?
I am out of capacity to take on this at the moment.
I am fine with the instanceof
check being completely removed.
Actually, it will be my next suggestion, haha, just check for not null value and remove instance of check.
https://github.com/gajus/brim/blob/809d68475504aa2482fadca1d90cb7620fb11bbd/src/brim.js#L19