KusStar / vite-plugin-glslify

A plugin for Vite to compile glslify shader code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Migration from npm to pnpm Causes Build Failures Due to Missing Dependency

AbsharHassan opened this issue · comments

Hello,

I am thrilled to have found your library as it is exactly what I needed in my vite-react-ts application. I want to thank all of the maintainers and contributors for creating this neat plugin. It was just what I was looking for!

Issue:

I've noticed that the project is transitioning from npm to pnpm as the package manager. Wishing to contribute by bumping deps (vite), I cloned the repo onto my local machine. However, I encountered an issue where the build fails under pnpm due to a missing module, estree-walker, which isn't listed in the package.json as a dependency. This wasn't a problem with npm, likely due to npm's less strict handling of nested dependencies.

Steps to Reproduce:

I am linking a CodeSandbox for the reviewer's convenience.

To reproduce the issue, simply clone the repo to your machine, install the dependencies, and run the start command:

pnpm install
pnpm start

This produces the following error:

src/literals_compiler.ts:2:21:
    2 │ import { walk } from 'estree-walker'

ESM Build failed
Error: Build failed with 1 error:
src/literals_compiler.ts:2:21: ERROR: Could not resolve "estree-walker"

Additionally, I observed that the script commands in package.json are still prefixed with npm instead of pnpm. This may lead to inconsistencies in dependency management and potential conflicts with lock files.

System Info:

  • node: v20.10.0
  • pnpm: v8.15.6

I would be happy to submit a PR rectifying these issues and bumping the vite dependency.

@KusStar your input would be highly valuable. Thank you.

Issue confirmed, seems like pnpm's peerDependency fetching logic is stricter than before, estree-walker should also be listed in package.json

image

It would be great if you would like to submit a PR.

@KusStar, thank you for your response! Yep, I added estree-walker in package.json and the build is successful. I have submitted a PR (#11) and would love to hear your feedback on it. Please review at your convenience