Comments (7)
Ok I think I found the issue, the tests failing had a problem because the 'fs' module was being mocked in a non proper way, looks that someone put the code there to mock the whole node_modules folder... 🤦🏻
So I'm sorting that now, sorry for the inconvenience :)
This can be closed
from next-test-api-route-handler.
This is interesting, because the Actions tests are still passing with node 20.x. I'll investigate this today.
from next-test-api-route-handler.
@desclapez Hmm, I can't seem to reproduce this on Linux (Ubuntu) using node 20.5.1 or 20.9.0 or Windows (Windows 10) using 18.18.2.
That EBADF: bad file descriptor, fstat
as the first error in the list is telling. Stackoverflow suggests this could be due to your Node runtime environment. Perhaps you're using some non-standard environment variables? These issues suggests that it's not a Node issue at all but an underlying filesystem/OS problem.
Do you have a different system you could run your tests on?
from next-test-api-route-handler.
Hi @Xunnamius, regarding my operating system, is Macosx Ventura, version 13.0. The hardware is an Apple M1 Pro Max. I've tried in another Macosx Ventura, version 13.6, running on an Apple M1 Pro Max and the result is the same.
Since I do not have another machine/s right now, I've tried the following using docker in my Apple laptop:
-
In ubuntu 20 and ubuntu 22 containers I have same results I've post in my first comment. Also I would like to mention that the pipeline of my personal project uses github actions with ubuntu 22.04 and the unit tests also fails with the same error.
-
Now I'm trying in both OS (macosx ventura and ubuntu 20/22) to clone this repo and run the tests, but all them failed in the
npm ci
step with the following error:
root@6320e42390c9:/var/local/next-test-api-route-handler# npm ci
npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
npm WARN deprecated @ergodark/[email protected]: this package has been superseded by @xunnamius/types
npm WARN tarball tarball data for semantic-release@https://xunn.at/semantic-release-atam (sha512-ClfsCGVF9IBrmQLJPGuaXw9+7R8KANo8r68NC/hSZpcVtl52RTuUgnLrFAmenu7nE5O9FpXd6reJdp2aueDzgQ==) seems to be corrupted. Trying again.
npm notice
npm notice New minor version of npm available! 10.1.0 -> 10.2.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.2.2
npm notice Run npm install -g [email protected] to update!
npm notice
npm ERR! code EINTEGRITY
npm ERR! sha512-ClfsCGVF9IBrmQLJPGuaXw9+7R8KANo8r68NC/hSZpcVtl52RTuUgnLrFAmenu7nE5O9FpXd6reJdp2aueDzgQ== integrity checksum failed when using sha512: wanted sha512-ClfsCGVF9IBrmQLJPGuaXw9+7R8KANo8r68NC/hSZpcVtl52RTuUgnLrFAmenu7nE5O9FpXd6reJdp2aueDzgQ== but got sha512-DHyVFdPSQLK6qwAdcsUqCmikH3+E1FjAT9Z9vb4iktOac0fRvgDvZV4MCGknqaXZ6+BB7aq5AaCnjs6dQ9gjuQ==. (425956 bytes)
npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2023-11-01T21_56_51_274Z-debug-0.log
Also I would like to mention that I manage the node versions with nvm use
& nvm install
, in case that matters.
from next-test-api-route-handler.
I can't seem to reproduce this on Linux (Ubuntu) using node 20.5.1 or 20.9.0 or Windows (Windows 10) using 18.18.2.
Btw I'm curious about the node version used in github actions, since it says 20.x but I would like to see in any log the actual current version being used (how that 20.x is being resolved), could you point me to it please? :)
from next-test-api-route-handler.
Btw I'm curious about the node version used in github actions, since it says 20.x but I would like to see in any log the actual current version being used (how that 20.x is being resolved), could you point me to it please? :)
You can see the specific node version selected here. Don't mind the 21.x test. Actually, I think only I can see this log. Oops!
I attempted to reproduce your result on my local machines using 20.5.1, 20.9.0, and 18.18.2.
from next-test-api-route-handler.
Ah, yeah, mocking fs too deeply can get pretty gnarly in my experience. No problem and thanks for investigating :)
from next-test-api-route-handler.
Related Issues (20)
- Relative URL doesn't work with appHandler: "Invalid URL" error HOT 4
- Insuffient type for `params` object given a well-typed dynamic route handler HOT 1
- Potential NTARH incompatibility with `next/jest.js` HOT 1
- originalGlobalFetch is not a function HOT 2
- Allow this to be used with Vitest HOT 2
- ValidationPipe not triggering in unit tests HOT 4
- next-test-api-route-handler (NTARH) failed to import api-utils.js HOT 2
- Verify support for app-based route handlers HOT 1
- Error: Invariant: Method expects to have requestAsyncStorage, none available HOT 3
- Incompatibility with [email protected] HOT 5
- Could not find a declaration file for module 'next-test-api-route-handler'. HOT 4
- Bypassing MSW does not work with MSW 2.X HOT 2
- Vercel lambda governing compatibility badge isn't tracking latest compat version anymore HOT 1
- App Router Examples HOT 2
- Drop node-fetch in favor of native fetch functionality HOT 1
- Jest did not exit one second after the test run has completed. HOT 3
- Catch all segments dynamic api routes HOT 1
- Recursive redirection occurs when redirecting within the handler HOT 3
- ReferenceError: Request is not defined HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from next-test-api-route-handler.