proper-software / mjml

Provides support for MJML templates in meteor/email package
2 stars 0 forks source link

ReferenceError: Can't find variable: Npm #2

Closed johnwils closed 3 years ago

johnwils commented 3 years ago

In the web browser I'm getting an error: ReferenceError: Can't find variable: Npm

I think this package is meant for server only, but it is being installed in both client and server.

I believe the line in package.js:

api.mainModule("mjml.ts");

can be changed to

api.mainModule("mjml.ts", "server");

This may solve the issue and remove the warning in the browser.

BTW - thanks for writing this package I find it is really helpful and useful.

tomasz-nolberczak commented 3 years ago

Hi, thanks for creating a new issue. I am going to check what is happening.

What version of Meteor are you using?

johnwils commented 3 years ago

Hi,

I cloned your package and made some changes and it seems to work now and error is gone.

I’m using Meteor 1.12. I had to update the mjml dependencies to the latest version (i.e. typescript) and specify ‘server’ in the mjml package.

Sent from my iPhone

On Dec 21, 2020, at 2:16 AM, Tomasz Nolberczak notifications@github.com wrote:

 Hi, thanks for creating a new issue. I am going to check what is happening.

What version of Meteor are you using?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

tomasz-nolberczak commented 3 years ago

Great! Thank you for your help out there. I think you can do a PR - then I will merged it with master 🙂

tomasz-nolberczak commented 3 years ago

@johnwils I spent some time today for doing a cleanup. I also fixed an issue you mentioned. Could you check if things are working correctly now within your project?

Let me know, if the changes I made are fine for you.

I am going to publish the newest version to the Atmosphere soon. Now I am having some strange authorization issue from the Meteor's CLI. When that one will be fixed, I will do it immediately.

PS: There are no tests yet - though I am going to add them in not too distant future, so I am sorry for that.