Skip to content

bug: Error: Module not found: Can't resolve 'net' when using postgres #634

@christo8989

Description

@christo8989

Provide environment information

  System:
    OS: macOS 13.0
    CPU: (8) arm64 Apple M1
    Memory: 1.07 GB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.18.0 - ~/.nvm/versions/node/v18.18.0/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 9.8.1 - ~/.nvm/versions/node/v18.18.0/bin/npm
    pnpm: 7.27.1 - /opt/homebrew/bin/pnpm

Describe the bug

iOS runs fine. But I get an issue with nextjs.

Error: Module not found: Can't resolve 'net'

[Import](https://nextjs.org/docs/messages/module-not-found) trace for requested module:
../../node_modules/postgres/src/index.js
../../packages/db/index.ts
../../packages/auth/index.ts
./src/app/_components/auth-showcase.tsx
./src/app/page.tsx
../../node_modules/next/dist/build/webpack/loaders/next-edge-ssr-loader/index.js?absolute500Path=&abs

Seems this is related to "use client" when used with postgres?

Link to reproduction

None

To reproduce

Replace the db with postgres.
Run yarn dev

Additional information

No response

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