Skip to content

使用wrangler部署到cloudflare wokers报错 #235

@hyperty

Description

@hyperty

X [ERROR] Could not resolve "fs/promises"

dist/server.js:9:25:
  9 │ import { readFile } from 'fs/promises';
    ╵                          ~~~~~~~~~~~~~

The package "fs/promises" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.

X [ERROR] Could not resolve "stream/web"

dist/server.js:16:20:
  16 │ import Streams from 'stream/web';
     ╵                     ~~~~~~~~~~~~

The package "stream/web" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.

X [ERROR] Could not resolve "async_hooks"

node_modules/.pnpm/[email protected]/node_modules/undici/lib/api/api-connect.js:4:34:
  4 │ const { AsyncResource } = require('async_hooks')
    ╵                                   ~~~~~~~~~~~~~

The package "async_hooks" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.

X [ERROR] Could not resolve "async_hooks"

node_modules/.pnpm/[email protected]/node_modules/undici/lib/api/api-pipeline.js:14:34:
  14 │ const { AsyncResource } = require('async_hooks')
     ╵                                   ~~~~~~~~~~~~~

The package "async_hooks" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions