Giter Site home page Giter Site logo

Comments (10)

jellydn avatar jellydn commented on July 24, 2024

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.

jellydn avatar jellydn commented on July 24, 2024

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.

jellydn avatar jellydn commented on July 24, 2024

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.

devanshSingh5656 avatar devanshSingh5656 commented on July 24, 2024

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
Capture

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.

jellydn avatar jellydn commented on July 24, 2024

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.

jellydn avatar jellydn commented on July 24, 2024

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.

devanshSingh5656 avatar devanshSingh5656 commented on July 24, 2024

used vercel deployment

from next-swagger-doc.

jellydn avatar jellydn commented on July 24, 2024

It shouldn't be an issue anymore. My example app is also deployed to vercel.

from next-swagger-doc.

devanshSingh5656 avatar devanshSingh5656 commented on July 24, 2024

can you make the package available on npm?

from next-swagger-doc.

jellydn avatar jellydn commented on July 24, 2024

It's published on npm already.

from next-swagger-doc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.