cloudflare / chanfana

OpenAPI 3 and 3.1 schema generator and validator for Hono, itty-router and more!
https://chanfana.pages.dev
MIT License
263 stars 35 forks source link

TypeError: o3.replace is Not a Function - Project Not Running #112

Closed rhutikcodes closed 6 months ago

rhutikcodes commented 6 months ago

Description:

I have been working on a project using itty-router-openapi, following the guide provided in the official documentation. The project was functioning correctly until recently. However, as of today, I am encountering an error that prevents the project from running.

Error Encountered The specific error I am facing is:

TypeError: o3.replace is not a function
This error occurs when I try to run the project. I have not made any major changes to the codebase that might have led to this issue. It seems to have arisen spontaneously.

Steps to Reproduce

  1. Set up a project following the steps in the itty-router-openapi guide.
  2. Run the project.
  3. Expected Behavior
  4. The project should run without any errors, as it was doing previously.

Actual Behavior The project fails to run, displaying the error message: TypeError: o3.replace is not a function.

Additional Information It seems that this issue is new, as the project was working fine until today. No significant changes were made to the codebase or the environment prior to the error occurring.

Screenshot

image

@G4brym Can you please check

G4brym commented 6 months ago

Hey @rhutikcodes can you confirm what version of wrangler and itty-router-open you are running? can you also post here your wrangler.toml?

rhutikcodes commented 6 months ago

name = "backend" main = "src/index.ts" compatibility_date = "2023-04-22"

"@cloudflare/itty-router-openapi": "^0.1.10", ( its breaking on all the versions)

if you delete your local node_modules and try it won't work

G4brym commented 6 months ago

we are no longer offering support to itty-router-openapi v0.x.x, can you try to upgrade to the latest version v1.0.6 Here's a migration guide

rhutikcodes commented 6 months ago

Even on the lastest version, its not running I followed this guide to create a fresh project, official documentation

G4brym commented 6 months ago

i was able to replicate your issue locally, let me work on fixing it now

G4brym commented 6 months ago

TLDR: The latest version of itty-router (the base library for this project) released about 10 hours ago broke some things, the quick fix for now is to force install the older version on your project with this command npm install itty-router@4.0.26

I will be releasing a new itty-router-openapi version today that locks this dependency instead of allowing patch updates

G4brym commented 6 months ago

Hey @rhutikcodes i've just released a new version of itty-router-open that fixes the issue (v1.0.7) Thanks for reporting this and let me know if you find any more issues