fastify / fastify-vite

Fastify plugin for Vite integration.
MIT License
849 stars 71 forks source link

NPM install fails with 'edgesout' error #136

Closed enpesavento closed 6 months ago

enpesavento commented 6 months ago

Prerequisites

Fastify version

4.26.0

Plugin version

6.0.2

Node.js version

21.6.2

Operating system

macOS

Operating system version (i.e. 20.04, 11.3, 10)

14.3.1

Description

When I try to run the installation command, an npm error appears:

npm ERR! Cannot read properties of null (reading 'edgesOut')

I also tried putting the latest version of the plugin in the dependencies, deleted the node_modules and the lock file and ran the install command and got this result:

"dependencies": {
    "@fastify/vite": "^6.0.2"
    ...
}
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: fastify-vite-test@0.0.1
npm ERR! Found: @fastify/vite@6.0.2
npm ERR! node_modules/@fastify/vite
npm ERR!   @fastify/vite@"^6.0.2" from the root project
npm ERR!   peer @fastify/vite@"^6.0.0-alpha.0" from @fastify/htmx@0.2.0
npm ERR!   node_modules/@fastify/htmx
npm ERR!     peer @fastify/htmx@"^0.2.0" from @fastify/vite@6.0.2
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @fastify/vite@"^5.0.5" from @fastify/react@0.3.0
npm ERR! node_modules/@fastify/react
npm ERR!   peer @fastify/react@"^0.3.0" from @fastify/vite@6.0.2
npm ERR!   node_modules/@fastify/vite
npm ERR!     @fastify/vite@"^6.0.2" from the root project
npm ERR!     1 more (@fastify/htmx)
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

With the previous major version (v5.0.6) of the plugin the installation works correctly.

~ npm i @fastify/vite@5.0.6

added 46 packages, and audited 765 packages in 8s

123 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

Steps to Reproduce

In a new folder:

~ npm init
~ npm i fastify @fastify/vite react react-dom

npm ERR! Cannot read properties of null (reading 'edgesOut')

Expected Behavior

No response

galvez commented 6 months ago

For the moment, use npm i <...> --legacy-peer-deps. I'll look into what needs to be done to fix this.

mcollina commented 6 months ago

@galvez stop using peerDependencies. They are more trouble than they are worth (unfortunately).

galvez commented 6 months ago

Latest release dropped peerDependencies.