NEROX
WWasp
•Created by Sven on 4/21/2025 in #đŸ™‹questions
Seo optimization
Hey Sven, if you want you can share the site so I can take a look at the SEO score?
18 replies
WWasp
•Created by mb23 on 4/16/2025 in #đŸ™‹questions
I'm getting this error when deploying my server to Railway
Try to replace:
by
import { load } from 'cheerio';
13 replies
WWasp
•Created by mb23 on 4/16/2025 in #đŸ™‹questions
I'm getting this error when deploying my server to Railway
What version of cheerio do you have in package.json? Something similar happened to me.
13 replies
WWasp
•Created by NEROX on 4/16/2025 in #đŸ™‹questions
Wasp TypeScript configuration - Split Wasp file
Oh yes, thank you Genyus!
6 replies
WWasp
•Created by NEROX on 4/9/2025 in #đŸ™‹questions
API auth with a Chrome Extension (third party)
I have created an issue because I have tried quite a few things and it doesn't fit in a Discord message: https://github.com/wasp-lang/wasp/issues/2646
14 replies
WWasp
•Created by NEROX on 4/9/2025 in #đŸ™‹questions
API auth with a Chrome Extension (third party)
@kapa.ai Explain me the full process of implementing JWT making sure that the JWT is from the device you are currently on. Have a secret also at the user level.
14 replies
WWasp
•Created by Sven on 3/29/2025 in #đŸ™‹questions
Change tab title to what page user is on
woah, since when is this possible?
16 replies
WWasp
•Created by Sven on 3/29/2025 in #đŸ™‹questions
Change tab title to what page user is on
we have also the
react-helmet-async
solution16 replies
WWasp
•Created by NEROX on 3/26/2025 in #đŸ™‹questions
[ Wasp ] core/auth.ts(17,7): error TS2742
Well, fixed after several
wasp clean
and wasp start
6 replies
WWasp
•Created by pipas on 3/18/2025 in #đŸ™‹questions
Best practices to verify files before uploading to S3?
After that I read the Pdf content with
pdf.js-extract
, maybe you can check if the reading process is successfully finished before uploading to S3.
// PDF extraction function that only checks if extraction is successful
import fs from 'fs';
import { PDFExtract } from 'pdf.js-extract';
export const extractPdf = async (filePath) => {
try {
// Check if file exists
if (!fs.existsSync(filePath)) {
return {
success: false,
message: 'File not found'
};
}
// Read the PDF file
const pdfBuffer = fs.readFileSync(filePath);
// Initialize PDF extractor
const pdfExtract = new PDFExtract();
// Attempt to extract content
const pdfData = await pdfExtract.extractBuffer(pdfBuffer);
// If we got here, extraction was successful
return {
success: true,
message: 'PDF extraction successful (Safe to upload it to S3)',
pageCount: pdfData.pages.length
};
} catch (error) {
// Handle specific errors
if (error.name === 'TypeError') {
return {
success: false,
message: 'Invalid PDF format',
error: error.message
};
}
// Handle any other errors
return {
success: false,
message: 'PDF extraction failed',
error: error.message
};
}
};
15 replies
WWasp
•Created by pipas on 3/18/2025 in #đŸ™‹questions
Best practices to verify files before uploading to S3?
I use
multer
to upload files to the server to a temp folder (ensuring it is *.pdf
extension) with an API (using import { tmpdir } from 'os';
)
// Configure multer for file uploads
const upload = multer({
dest: tmpdir(), // Use system's temporary directory
limits: { fileSize: 10 * 1024 * 1024 } // 10MB size limit
});
export const uploadFileApi = async (req, res, context) => {
// Check if user is authenticated
if (!context.user) {
return res.status(401).json({ message: 'Unauthorized' });
}
// Set up multer middleware for single file upload
const singleUpload = upload.single('file');
singleUpload(req, res, async function(err) {
// Handle upload errors
if (err) {
return res.status(400).json({ message:
File upload error: ${err.message} });
}
// Check if file was provided
if (!req.file) {
return res.status(400).json({ message: 'No file was provided' });
}
try {
// File successfully uploaded to temporary location
console.log('File uploaded successfully:', req.file.originalname);
// Return success response
return res.json({
success: true,
filename: req.file.originalname,
path: req.file.path
});
} catch (error) {
// Handle any other errors
console.error('Error processing file:', error);
return res.status(500).json({
message: 'Error processing uploaded file'
});
}
});
};
15 replies
WWasp
•Created by NEROX on 3/21/2025 in #đŸ™‹questions
Non-Dev question about APIs
@kapa.ai What would be the difference in the Extension and the Api using wasp:sessionId or for getSessionId() from wasp/client/api?
Is the same? Explain the differences, could I get sessionId from API call?
20 replies
WWasp
•Created by NEROX on 3/21/2025 in #đŸ™‹questions
Non-Dev question about APIs
@kapa.ai
How secure is
wasp:sessionId
to use as auth in a Chrome extension that calls the app API?20 replies
WWasp
•Created by NEROX on 3/19/2025 in #đŸ™‹questions
Property does not exist on type
forgot to refresh browser lol
12 replies
WWasp
•Created by NEROX on 3/19/2025 in #đŸ™‹questions
Property does not exist on type
@kapa.ai
wasp 0.15.0 to wasp 0.16.2
Error:
[plugin:vite:import-analysis] Failed to resolve import "wasp/client/webSocket/WebSocketProvider" from "src/index.tsx". Does the file exist?
/home/rootall/apps/ask-the-documents/.wasp/out/web-app/src/index.tsx:12:34
8 | queryClientInitialized
9 | } from "wasp/client/operations";
10 | import { WebSocketProvider } from "wasp/client/webSocket/WebSocketProvider";
Code (wasp 0.15.0):
import { Server } from 'socket.io'
import { type WebSocketDefinition, type WaspSocketData } from 'wasp/server/webSocket'
What's wrong? What should be in latest wasp version? what's new? how to solve import?12 replies
WWasp
•Created by NEROX on 3/21/2025 in #đŸ™‹questions
Non-Dev question about APIs
@kapa.ai Wait, can I call an operation within an API? Without the need to rewrite the logic I would do?
20 replies
WWasp
•Created by AC on 3/19/2025 in #đŸ™‹questions
Has there been any work done to SEO optimize the OpenSaaS landing page?
Hope this helps in some way https://gist.github.com/NeroxTGC/27a588ad5d78cf09a0b4464321eb5921
9 replies
WWasp
•Created by NEROX on 3/19/2025 in #đŸ™‹questions
Property does not exist on type
✅ Fixed adding them to Zod (src/env.ts)
12 replies
WWasp
•Created by NEROX on 3/17/2025 in #đŸ™‹questions
Generate User API Key for external calls
@kapa.ai How to integrate JWT with auth:true API in wasp?
16 replies
WWasp
•Created by NEROX on 3/17/2025 in #đŸ™‹questions
Generate User API Key for external calls
@kapa.ai
How to create and use Auth on API?
main.wasp
// API for Chrome extension
api askDocumentsApi {
fn: import { askDocumentsApi } from "@src/apis.js",
entities: [Document, Section],
httpRoute: (POST, "/api/ask"),
auth: true
}
apis.js
// API endpoint for the Chrome extension
export const askDocumentsApi = async (req, res, context) => {
try {
// Check if user is authenticated
if (!context.user) {
return res.status(401).json({ error: "Unauthorized. Please log in to use this API." });
}
16 replies