Skip to content

Content fetch error in Deno #3289

Open
Open
@finxol

Description

@finxol

Environment

Version

3.3.0

Reproduction

I think any Nuxt Content project would be affected, although feel free to reproduce using https://github.com/finxol/blog

Description

When hitting a dynamic route via client navigation, content gets fetched without issue.
When hitting the same route directly via url, an error occurs, resulting in a 404.

Reproducing the error when running with Deno 2.2.4 locally, I get this error logged to console:

[request error] [unhandled] [POST] http://localhost/api/content/posts/query?v=v3.3.0--TBYPjhA10F
 ReferenceError: Buffer is not defined
    at file:///Users/finxol/Projects/dev/p/web/blog/.output/server/chunks/nitro/nitro.mjs:831:7
    at eventLoopTick (ext:core/01_core.js:177:7)
    at async readBody (file:///Users/finxol/Projects/dev/p/web/blog/.output/server/chunks/nitro/nitro.mjs:895:16)
    at async Object.handler (file:///Users/finxol/Projects/dev/p/web/blog/.output/server/chunks/nitro/nitro.mjs:6681:19)
    at async Object.handler (file:///Users/finxol/Projects/dev/p/web/blog/.output/server/chunks/nitro/nitro.mjs:1674:19)
    at async toNodeHandle (file:///Users/finxol/Projects/dev/p/web/blog/.output/server/chunks/nitro/nitro.mjs:1945:7)
    at async b (file:///Users/finxol/Projects/dev/p/web/blog/.output/server/chunks/nitro/nitro.mjs:632:6914)
    at async O (file:///Users/finxol/Projects/dev/p/web/blog/.output/server/chunks/nitro/nitro.mjs:632:7197)
    at async $fetchRaw2 (file:///Users/finxol/Projects/dev/p/web/blog/.output/server/chunks/nitro/nitro.mjs:2434:26)
    at async $fetch2 (file:///Users/finxol/Projects/dev/p/web/blog/.output/server/chunks/nitro/nitro.mjs:2492:15)
Caused by ReferenceError: Buffer is not defined
    at file:///Users/finxol/Projects/dev/p/web/blog/.output/server/chunks/nitro/nitro.mjs:831:7
    at eventLoopTick (ext:core/01_core.js:177:7)
    at async readBody (file:///Users/finxol/Projects/dev/p/web/blog/.output/server/chunks/nitro/nitro.mjs:895:16)
    at async Object.handler (file:///Users/finxol/Projects/dev/p/web/blog/.output/server/chunks/nitro/nitro.mjs:6681:19)
    at async Object.handler (file:///Users/finxol/Projects/dev/p/web/blog/.output/server/chunks/nitro/nitro.mjs:1674:19)
    at async toNodeHandle (file:///Users/finxol/Projects/dev/p/web/blog/.output/server/chunks/nitro/nitro.mjs:1945:7)
    at async b (file:///Users/finxol/Projects/dev/p/web/blog/.output/server/chunks/nitro/nitro.mjs:632:6914)
    at async O (file:///Users/finxol/Projects/dev/p/web/blog/.output/server/chunks/nitro/nitro.mjs:632:7197)
    at async $fetchRaw2 (file:///Users/finxol/Projects/dev/p/web/blog/.output/server/chunks/nitro/nitro.mjs:2434:26)
    at async $fetch2 (file:///Users/finxol/Projects/dev/p/web/blog/.output/server/chunks/nitro/nitro.mjs:2492:15) {
  statusCode: 500,
  fatal: false,
  unhandled: true,
  statusMessage: undefined,
  data: undefined
}

The Nuxt site is built with nuxt build

Additional context

Originally got the issue in Deno Deploy, but reproduced locally with Deno.

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions