Skip to content

Execution error with pnpm #1018

@sjm00010

Description

@sjm00010

Describe the bug
When the package installation is done with pnpm the installed package does not work, giving the following error when trying to run it (the example is using pnpm run dev but it has been replicated with bun and npm and gave the same error).

error

However, if you delete the node_modeles folder and install using bun or npm the execution works correctly.

good

To Reproduce
Steps to reproduce the behavior:

  1. Create a sample project, in my case I was testing Hono. bunx create-hono my-app
  2. Install supabase: pnpm install @supabase/supabase-js
  3. In the index.ts file, copy the next:
import { Hono } from 'hono'
import { createClient } from '@supabase/supabase-js'

// EXAMPLE: Create a single supabase client for interacting with your database
const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key')

const app = new Hono()

app.get('/', (c) => {
  return c.text('Hello Hono!')
})

export default app
  1. Make sure that all dependencies, especially supabase, have been installed with pnpm i.
  2. Execute the program: pnpm run dev.

Expected behavior
You should get the following error by console:

1 | (function (entry, fetcher)
    ^
SyntaxError: Export named 'createClient' not found in module 'E:\hono-test\my-app\node_modules\@supabase\supabase-js'.
2 | export default "";
    ^
SyntaxError: Export named 'createClient' not found in module 'E:\hono-test\my-app\node_modules\@supabase\supabase-js'.

Screenshots
error

System information

  • Version of OS: Windows 10 22H2
  • Version of pnpm: 8.15.6
  • Version of Node.js: 20.10.0
  • Version of Bun.js: 1.1.3
  • Versions of Supabase: 2.39.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions