Closed cosmin-novac closed 3 years ago
Quick note: I've installed ejs v3.1.6 via npm, but I just noticed that jepub comes with its own ejs@2.7.4 postinstall...
If you're building from source code, it's actually crashing. I'm developing on branch... master (つ﹏<。)
No, I just installed jEpub via npm, that is definitely the tagged v.2.1.4
And regarding ejs, I went down to v2.7.4 on my npm dependency, and then I removed it completely and just used the module in jEpub, but the error still persists... Any ideas?
Check it out https://codesandbox.io/s/7thjk
Hm, I'm not sure what I'm supposed to be looking at? Setting the global.ejs? Or adding metadata console logs to debug? Locally it's working fine, there is no issue.
I forked the repo and tried bumping ejs to the latest version as well as hardcoding the i18n labels, but the error persists...
I just ran the project with the production flag activated, and now I can reproduce the issue locally. So I guess it must have something to do with dev dependencies...
I created a branch on the last commit that it was working on.
git checkout develop
npm install
npm start
Thanks.
In case someone else is struggling with this: I identified the cause of the issue, I'm using meteor's standard minifier in production. It seems minifying js files messes with ejs templates. I'm now working to either skip minification for this package completely, or to identify what part can't be properly minified.
Ok, so after some struggle, the solution was quite simple. I loaded both ejs and jepub directly from a CDN instead of adding them via the dependency tree. This way they simply skip any build/minimization process.
I think both the webpack minification and the jake postinstall had caused conflicts with my own minifier, so the pre-built versions solved it.
Thanks for the support!
Everything is working fine locally, but as soon as I deploy the project, it seems that ejs has an issue with a template. I couldn't figure out what's wrong and can't reproduce locally... any ideas?
The code up to that point is as simple as it gets: