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

[Jobs/Tasks] SyntaxError: Cannot use import statement outside a module #9453

Open
devcshort opened this issue Nov 22, 2024 · 0 comments
Open
Labels
status: needs-triage Possible bug which hasn't been reproduced yet

Comments

@devcshort
Copy link

Describe the Bug

I've followed the jobs/tasks guide and am getting this error.

import type { TaskHandler } from 'payload';
^^^^^^
          
SyntaxError: Cannot use import statement outside a module

I've created a new project using npx create-payload-app@latest and recreated a minimal example in this repo

Link to the code that reproduces this issue

https://github.com/devcshort/payload-task-issue

Reproduction Steps

npm install

npm run dev

HTTP GET http://localhost:3000/my-route

That should be it. The API route is configured to queue and run the job/task that I've set up.

Which area(s) are affected? (Select all that apply)

area: core

Environment Info

Payload: latest
Next.js: 15.0.0
Node.js: 20.12.2
NPM: 10.5.0
@devcshort devcshort added status: needs-triage Possible bug which hasn't been reproduced yet validate-reproduction labels Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs-triage Possible bug which hasn't been reproduced yet
Projects
None yet
Development

No branches or pull requests

1 participant