Error when I installed puppeteer and turndown
The client doesn't start when I installed I think it's because of the sub dependency. agent-base and proxy-agent.
"puppeteer": "^24.2.0",
and "turndown": "^7.2.0",
.
20 Replies
Hi @mm. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the information provided in the knowledge sources, I don't have enough specific details to directly address your error with puppeteer and turndown. However, I can provide some general insights about dependency management in Wasp that might be helpful:
1. Wasp has a specific way of handling dependencies. As mentioned in Github Issue 1597, Wasp projects now have a top-level
package.json
and node_modules
.
2. When adding new dependencies, you should be careful about potential conflicts. As noted in Github Issue 1859, Wasp consolidates user dependencies with framework dependencies, and there can be version conflicts.
3. If you're experiencing issues after adding new dependencies, you might need to restart the Wasp development server. As discussed in Github Issue 269, changes in dependencies might require restarting wasp start
or running npm install
automatically.
4. Make sure you're not adding these dependencies directly to the generated package.json
files. Instead, you should add them to your project's root package.json
or use the dependencies
field in your .wasp
file.
5. If the problem persists, you might want to check for any version conflicts between these new dependencies and Wasp's existing dependencies.
To get more specific help, you might want to share the exact error message you're seeing when the client doesn't start. Also, consider sharing your .wasp
file and root package.json
content with the Wasp community for more targeted assistance.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @mm, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?upon narrowing it down puppeteer is causing it. found this github issue as well https://github.com/puppeteer/puppeteer/issues/11881
GitHub
[Bug]: Class extends value undefined is not a constructor or null w...
Minimal, reproducible example import puppeteer from 'puppeteer' (async () => { // Launch the browser const browser = await puppeteer.launch(); // Create a page const page = await browser...
awesome! thanks for the follow-up.
Np. I haven't fixed it yet tho. I really need puppeteer for this project. seems like a compilation issue it says when you build with vite? not sure
ts errors are always a job for @Filip
@mm I think you're probably importing server-side code (puppeteer) in client files (code that ends up on the frontend). Could you double check that?
Hi @Filip the puppeteer is imported in a utility. here are the files that uses it. everything seems to be server side?

Are you importing something that is importing pupeteer? π If the error is reported in the browser console, it must be imported somewhere on the client
@mm If you don't mind sharing the project in a zip, we can help you out
yes @miho I created a separate util that utilizes puppeteer and export it from utils so that I only import from utils.ts
@miho @Filip is it okay to use puppeteer or any server side package under
app/src/server/utils.ts
?Yes, but it seems you're importing it on the client somehow
Do you mind sharing the project so I can dig in?
wait
I just created a new project
Ok, perfect, if you could create a minimal reproduction, that's even better! π
Here @Filip I just created a util in
app/src/server/utils.ts
using puppeteer
https://github.com/medardm/test-waspsaasGitHub
GitHub - medardm/test-waspsaas
Contribute to medardm/test-waspsaas development by creating an account on GitHub.
Hm, seems like you're imporint puppeteer into
payment/plans
, which are used in client components. I think that's the proble
Yes, that's definitely the problem π
Nice work spotting this, it's a mistake on our part (since some of these utils end up being used on the frontend, but the file's name server/utils
implies otherwise)
@Vinny (@Wasp) One for you here, did I get it right?I see for temp solution should I move
requireNodeEnvVar
from server/utils
then @Filip ? and import it separately. or move it to like client/utils
move the pupeteer function to it's own file, something like
server/puppeteer.ts
and try importing into your serverside functions that way. Let me know if that works.Wohooo @Vinny (@Wasp), you just became a Waspeteer level 47!
yeah it looks like that's what's happening. I made an issue for it here: https://github.com/wasp-lang/open-saas/issues/370
GitHub
organize
server/utils.ts
functions so that they aren't being impo...We're importing requireNodeEnvVar into the payment/plans.ts and then some of these variables are being imported onto the client, causing clientside errors if the user extends the utils.ts file ...
thanks @Vinny (@Wasp) I will assess since maybe moving
requirenodeenv
will be easier for me since many of the utils exported from server/utils
makes use of the puppeteer. Will let you know which one works