Comments (10)
Hi @devanshSingh5656. Thank you for your report. Could you tell me the usage? Which one are you using? https://github.com/jellydn/next-swagger-doc#usage-1-create-an-single-api-document or https://github.com/jellydn/next-swagger-doc#usage-2-use-nextjs-api-route-for-create-swagger-json-spec
It would be helpful for me investigating if you share the package.json and next.config.js. Thanks.
from next-swagger-doc.
At first glance, I guess the fs
is a native module on NodeJs and you got the error with fs
module which means you're calling serverside function
from the browser. 🤔
from next-swagger-doc.
Please check the example app https://github.com/jellydn/next-swagger-doc/blob/main/example/README.md if you want to see how it works. Thanks.
from next-swagger-doc.
i am using createSwaggerSpec for multiple api's but it throws the error
but when i use with changes in next config
module.exports = {
webpack(config,{ isServer }) {
config.module.rules.push({
test: /.svg$/,
use: ["@svgr/webpack"],
});
if (!isServer) {
config.node = {
fs: 'empty'
};
}
return config;
},
};
it works but when i deployed it on server api's are not visible
package.json
{
"name": "api",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
},
"dependencies": {
"@svgr/webpack": "^5.5.0",
"axios": "^0.21.1",
"bcrypt": "^5.0.1",
"bcryptjs": "^2.4.3",
"bootstrap": "^5.0.1",
"cookie-parser": "^1.4.5",
"cookies": "^0.8.0",
"express": "^4.17.1",
"jsonwebtoken": "^8.5.1",
"mongoose": "^5.12.9",
"next": "10.2.0",
"next-api-url": "^1.0.0",
"next-swagger-doc": "^0.1.5",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-redux": "^7.2.4",
"reactjs-popup": "^2.0.4",
"redux": "^4.1.0",
"swagger-jsdoc": "^6.1.0",
"swagger-ui-react": "^3.51.0",
"swr": "^0.5.6"
}
}
from next-swagger-doc.
re.
it works but when i deployed it on server api's are not visible
So it's working on local but it's showing empty on production deployment, right? Interesting 🤔 . How do you set up the deployment? It could give me some insights to think about this. Thanks.
from next-swagger-doc.
Hi @devanshSingh5656 Please check out the latest version https://github.com/jellydn/next-swagger-doc/releases/tag/v0.1.7 Let me know if that works for you. Thanks.
from next-swagger-doc.
used vercel deployment
from next-swagger-doc.
It shouldn't be an issue anymore. My example app is also deployed to vercel.
from next-swagger-doc.
can you make the package available on npm?
from next-swagger-doc.
It's published on npm already.
from next-swagger-doc.
Related Issues (20)
- Module not found: Can't resolve '#apg-lite' HOT 1
- Issue with parameters and swcMinify HOT 2
- Example or Docs required to explain how to specify params?
- api doesn't load component on production HOT 9
- Compatibility issues with NodeJS 16+ (version 19.7.0 / 16.19.1) on Windows, Ubuntu, and Heroku
- `Argument of type 'Promise<typeof import("...@types/swagger-ui-react/index")>' is not assignable to parameter of type 'DynamicOptions<{ spec: any; }> | Loader<{ spec: any; }>'. HOT 1
- Authorize using Bearer or OAuth2 HOT 1
- How to manage multiple HTTP methods
- Theme | no light mode support ? HOT 1
- Next13 example project running issue HOT 4
- Swagger annotations $ref as string HOT 1
- Automated doc generation HOT 7
- Where to keep the schema.json file in next.js project?
- Not working on Next 13 HOT 1
- Issue when using different directory such as src HOT 1
- Swagger Specs Never Read HOT 4
- Empty paths in rendered JSON in Production (on Vercel) but not in Dev with NextJS 14 HOT 1
- README Documentation has a missing dependency HOT 2
- Error with yarn build with Next 14 HOT 3
- Error on build - Next.js 14 - TypeError: Class extends value undefined is not a constructor or null HOT 5
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-swagger-doc.