Yarn Plug'n'Play fails packageDependencies, but I'm not using Yarn! (PlanetScale)

I’m attempting to use the PlanetScale integration with some sample code. I have the file store_user.ts in my netlify/functions directory. But the first line gives me problems:

import { withPlanetscale } from '@netlify/planetscale'

The failure is below. The confusing part is I’m not using yarn, I’ve never used yarn in this app, and there are no yarn files in my repo. I have @netlify/planetscale in my package.json and it’s been installed (I see it in node_modules).

Build log:

◈ Reloading function store-user...
✘ [ERROR] Could not resolve "@netlify/planetscale"

    netlify/functions/store-user.ts:2:32:
      2 │ import { withPlanetscale } from '@netlify/planetscale'
        ╵                                 ~~~~~~~~~~~~~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "@netlify/planetscale" here because it's not
  listed as a dependency of this package:

    ../../../.pnp.cjs:1107:33:
      1107 │           "packageDependencies": [
           ╵                                  ^

  You can mark the path "@netlify/planetscale" as external to exclude it from the bundle, which will
  remove this error and leave the unresolved path in the bundle.

I don’t think I’m doing anything special; just following the instructions on how it seems you’re supposed to enable this integration. But I don’t see any reference to this error elsewhere, which surprises me. Any assistance is gratefully appreciated.

Could you try setting an environment variable: NETLIFY_USE_YARN to false, while trying to build and/or run netlify dev?

Not sure why it’s happening but that seems like a cheap thing to try (cf Manage build dependencies | Netlify Docs)

I forgot to mention, I resolved this issue. I ended up uninstalling yarn completely from my system. Luckily I wasn’t using it anywhere else. Good to know about that environment variable, I’ll have to set that if I decide to use yarn somewhere else.

thanks for sharing this with the community!