Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example doesn't compile #2

Open
eaoliver opened this issue Jan 5, 2024 · 5 comments
Open

Example doesn't compile #2

eaoliver opened this issue Jan 5, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@eaoliver
Copy link

eaoliver commented Jan 5, 2024

Steps to reproduce from: /next-server-task/examples/openai-image-generator

pnpm install 
pnpm build 

Module not found: Can't resolve 'next-server-task'

1 | import { TaskError } from "next-server-task";
2 | import { createTask } from "next-server-task/server";

Module not found: Can't resolve 'next-server-task/server'
1 | import { TaskError } from "next-server-task";

2 | import { createTask } from "next-server-task/server";
3 | import { OpenAI } from "openai";

@2-fly-4-ai
Copy link

Yeah I have the same issue.

@Neo-Ciber94 Neo-Ciber94 added the bug Something isn't working label Jan 10, 2024
@Neo-Ciber94 Neo-Ciber94 self-assigned this Jan 10, 2024
@Neo-Ciber94
Copy link
Owner

I think the cause is because running pnpm install on the example do not build the library.

Try:

Build the library

cd package && pnpm build

And then in other shell
cd examples/openai-image-generator && pnpm install && pnpm build

@2-fly-4-ai
Copy link

Yeah, the typings and stuff are all off as well. But.. I got it to work, and I'm bulk processing about 15 images in 20sec+-. Nice job, thanks. It would be cool if we could track down the source of the issue. I'll just have to bypass it for now.

This is a really nice solution to dealing with long-running serverless tasks.

@Neo-Ciber94
Copy link
Owner

@2-fly-4-ai Are you using the library from npm npm i next-server-task or from the source?

If you are using it directly from the source, I think may be related to not building the lib as I mentioned above.

@2-fly-4-ai
Copy link

I think we're all installing it through npm. I'm getting red lines on the imports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants