marti
marti
WWasp-lang
Created by marti on 4/10/2024 in #🙋questions
server env variables cause process is not defined
thank you so much 🙏
27 replies
WWasp-lang
Created by marti on 4/10/2024 in #🙋questions
server env variables cause process is not defined
No, I imported it from actions import { sendEmail } from "../../actions/sendEmail";
27 replies
WWasp-lang
Created by marti on 4/10/2024 in #🙋questions
server env variables cause process is not defined
I got actually
[plugin:detect-server-imports-on-client] File /Users/martinazrnec/Documents/workspace/luvano-homes/luvano/src/actions/sendEmail.ts contains a server import. This is not allowed in the client code.
[plugin:detect-server-imports-on-client] File /Users/martinazrnec/Documents/workspace/luvano-homes/luvano/src/actions/sendEmail.ts contains a server import. This is not allowed in the client code.
And I followed the docs and did same as they did import { emailSender } from "wasp/server/email"; So my sendEmail.ts looks like
import { emailSender } from "wasp/server/email";

type EmailPayload = {
email: string;
from: string;
title: string;
text: string;
};

export const sendEmail = async (props: EmailPayload) => {
const { email, from, title, text } = props;
const info = await emailSender.send({
from: {
name: from,
email: email,
},
to: "***@gmail.com",
subject: title,
text: text,
html: text,
});
return info;
};
import { emailSender } from "wasp/server/email";

type EmailPayload = {
email: string;
from: string;
title: string;
text: string;
};

export const sendEmail = async (props: EmailPayload) => {
const { email, from, title, text } = props;
const info = await emailSender.send({
from: {
name: from,
email: email,
},
to: "***@gmail.com",
subject: title,
text: text,
html: text,
});
return info;
};
But apparently I am doing something wrong. Can you help me?
27 replies
WWasp-lang
Created by marti on 4/10/2024 in #🙋questions
server env variables cause process is not defined
I tried upgrading wasp, but now I get err
Your Wasp version does not match the app's requirements.
You are running Wasp 0.13.1.
This app requires Wasp ^0.12.3.
To install specific version of Wasp, do:
curl -sSL https://get.wasp-lang.dev/installer.sh | sh -s -- -v x.y.z
where x.y.z is your desired version.
Check https://github.com/wasp-lang/wasp/releases for the list of valid versions.
Your Wasp version does not match the app's requirements.
You are running Wasp 0.13.1.
This app requires Wasp ^0.12.3.
To install specific version of Wasp, do:
curl -sSL https://get.wasp-lang.dev/installer.sh | sh -s -- -v x.y.z
where x.y.z is your desired version.
Check https://github.com/wasp-lang/wasp/releases for the list of valid versions.
😫
27 replies
WWasp-lang
Created by marti on 4/10/2024 in #🙋questions
server env variables cause process is not defined
yes, that was my thought as well, but nowhere in the client is using process and when I track the err in console it leads me to wasp part -> ApiKey: process.env.SENDGRID_API_KEY,
27 replies
WWasp-lang
Created by marti on 4/10/2024 in #🙋questions
server env variables cause process is not defined
- I might just start over haha...I have not that manny stuff to c/p
27 replies
WWasp-lang
Created by marti on 4/10/2024 in #🙋questions
server env variables cause process is not defined
when I did this curl -sSL https://get.wasp-lang.dev/installer.sh | sh -s -- -v 0.13.1 and when I do wasp start I see error
Your Wasp version does not match the app's requirements.
You are running Wasp 0.13.1.
This app requires Wasp ^0.12.3.
To install specific version of Wasp, do:
curl -sSL https://get.wasp-lang.dev/installer.sh | sh -s -- -v x.y.z
where x.y.z is your desired version.
Check https://github.com/wasp-lang/wasp/releases for the list of valid versions
Your Wasp version does not match the app's requirements.
You are running Wasp 0.13.1.
This app requires Wasp ^0.12.3.
To install specific version of Wasp, do:
curl -sSL https://get.wasp-lang.dev/installer.sh | sh -s -- -v x.y.z
where x.y.z is your desired version.
Check https://github.com/wasp-lang/wasp/releases for the list of valid versions
27 replies
WWasp-lang
Created by marti on 4/10/2024 in #🙋questions
server env variables cause process is not defined
ok sorry 😄 no terminal error, this error si from browser console this happened after I replaced dummy email provider with sendgrid so what I did was creted .env.server in root with SENDGRID_API_KEY= in main.wasp I did this
emailSender: {
provider: SendGrid,
defaultFrom: {
name: "default",
},
}
emailSender: {
provider: SendGrid,
defaultFrom: {
name: "default",
},
}
and that's it, after I restarted the server I saw this err
27 replies
WWasp-lang
Created by marti on 4/10/2024 in #🙋questions
server env variables cause process is not defined
The error exactly is what I said above. Uncaught reference error: process is not defined. And if I go into the error it is where sendgrid api key is used. Const emailProvider = { Type: ‘sendgrid’, ApiKey: process.env.SENDGRID_API_KEY, } as const;
27 replies