Closed FaiezWaseem closed 4 months ago
I have the same after updating to latest AdonisJS
Oh boy... I hate the JS stack 🙄 will have a look into it
Is this a Windows-only error, or a Node version error? https://stackoverflow.com/questions/69665780/error-err-unsupported-esm-url-scheme-only-file-and-data-urls-are-supported-by
I can't reproduce it on Linux with Node v21.6.1
I just deployed a possible fix in 3.47.0. Can you guys test it with that version? Otherwise I might need some help here from the windows folks.
@ad-on-is Ok i will test it now
well So I tried the update . When i run the command node ace docs:generate , it runs successfully but when visits the docs
But when i debug a little more i added this route
router.get('/swagger.json', async () => {
const json = fs.readFile('swagger.json','utf8')
return AutoSwagger.default.writeFile(json, swagger);
});
now its giving this error
but comment.ts exists , it have already created the swagger.json
here is the github repo of my project
Node v21.7.3 AdonisJs ^6.9.0 adonis-autoswagger ^3.47.0
Thx for the reproduction... This is an issue with node ace serve --hmr
Using node ace serve --watch
however, works as expected.
@FaiezWaseem
Also... your config is wrong here.
router.get("/swagger", async () => {
return router.toJSON()
});
router.get("/docs", async () => {
return AutoSwagger.default.ui("/swagger", swagger);
});
should be
router.get("/swagger", async () => {
return AutoSwagger.default.docs(swagger);
});
router.get("/docs", async () => {
return AutoSwagger.default.ui("/swagger", swagger);
});
Close in favor of https://github.com/ad-on-is/adonis-autoswagger/issues/102
Yup fixed Working now
Hi upon running
node ace docs:generate
it worked before , but now after adding vinejs and validations now on running this command suddenly i am getting this error[ error ] Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, abs olute paths must be valid file:// URLs. Received protocol 'c:' at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:239:11) at defaultLoad (node:internal/modules/esm/load:130:3) at nextLoad (node:internal/modules/esm/hooks:750:28) at C:\Development\web\node\adonijs-nextjs\server\node_modules\ts-node\src\esm.ts:255:45 at async addShortCircuitFlag (C:\Development\web\node\adonijs-nextjs\server\node_modules\ts-node\src\esm. ts:409:15) at async nextLoad (node:internal/modules/esm/hooks:750:22) at async Hooks.load (node:internal/modules/esm/hooks:383:20) at async handleMessage (node:internal/modules/esm/worker:199:18)