Open gslender opened 2 years ago
Example that I'm using (of which card.html is the file in the project's test folder)
const BootstrapEmail = require('bootstrap-email');
const bootstrapEmail = new BootstrapEmail(__dirname+'/card.html');
bootstrapEmail.compileAndSave(__dirname+'/e-card.html');
I also tried node v14 and earlier versions of your package and nothing works, which means either I'm doing something majorly incorrect, or there is some environmental dependency that isn't obvious.
Any tips?
same issue for us as well, would be cool to get some insights 😅
To replicate:
https://codesandbox.io/s/node-js-forked-eby4cz?file=/src/index.js:68-77
We were able to somewhat fix it at the first glance by using cheerio 0.22.0 - ofc that might lead to other side effects we have not uncovered. But might be worth a try.
// package.json
{
"name": "node-js",
"version": "1.0.0",
"description": "",
"main": "src/index.js",
"scripts": {
"start": "nodemon src/index.js localhost 8080"
},
"dependencies": {
"express": "4.16.4",
"bootstrap-email": "1.2.9",
"cheerio": "0.22.0"
},
"devDependencies": {
"nodemon": "1.18.4"
},
"resolutions": {
"cheerio": "0.22.0"
},
"keywords": []
}
Interesting that in the repo package.json it refers to cheerio v1.0.0-rc.10 and yet cheerio v1.0.0-rc.11 is the latest
Perhaps that's the issue ??
I've moved on and avoided using the package at this point as without any feedback, I can't invest more time trying to work on this when I've got so much more to do :P
So it is indeed rc-10 not 0.22.0 - for some reason the code sandbox does weird things. Using resolution
to fix it that seems to work.
// package.json
{
"name": "node-js",
"version": "1.0.2",
"description": "",
"main": "src/index.js",
"scripts": {
"start": "nodemon src/index.js localhost 8080"
},
"dependencies": {
"bootstrap-email": "1.2.9",
"cheerio": "1.0.0-rc.10",
"express": "4.16.4"
},
"devDependencies": {
"nodemon": "1.18.4"
},
"resolutions": {
"cheerio": "1.0.0-rc.10"
},
"keywords": []
}
So it is indeed rc-10 not 0.22.0 - for some reason the code sandbox does weird things. Using
resolution
to fix it that seems to work.// package.json { "name": "node-js", "version": "1.0.2", "description": "", "main": "src/index.js", "scripts": { "start": "nodemon src/index.js localhost 8080" }, "dependencies": { "bootstrap-email": "1.2.9", "cheerio": "1.0.0-rc.10", "express": "4.16.4" }, "devDependencies": { "nodemon": "1.18.4" }, "resolutions": { "cheerio": "1.0.0-rc.10" }, "keywords": [] }
Although @knopkem new package works great, I would say this is the right solution. Since it amends the original package without changing it and thus you won't have to detach from it. Bravo @manuel-schoebel on discovering this fix, when there is so little to none information available online and also the owner of this project is not been so responsive. Great tool, apart from this issue.
Not sure what the issue is, but cannot get any examples to work at all...