Coder Social home page Coder Social logo

Comments (36)

VictoriqueMoe avatar VictoriqueMoe commented on May 27, 2024 2

PR is ready ;).

Wohh, wait until I tested the above

from tsed.

Romakita avatar Romakita commented on May 27, 2024 1

ok after running migration it works :)

from tsed.

Romakita avatar Romakita commented on May 27, 2024 1

Can you try that:

export const SWAGGER_UI_DIST = dirname(url.fileURLToPath(import.meta.resolve('swagger-ui-dist')))

normalize function isn't necessary, because the SWAGGER_UI_DIST is path consumer by a Fs lib.

from tsed.

Romakita avatar Romakita commented on May 27, 2024

Hello @VictoriqueMoe
I just tried to reproduce and this swagger load correctly in a pure ESM project.

I'll checkout your project to see if there is something different.

See you

from tsed.

VictoriqueMoe avatar VictoriqueMoe commented on May 27, 2024

Hello @VictoriqueMoe I just tried to reproduce and this swagger load correctly in a pure ESM project.

I'll checkout your project to see if there is something different.

See you

weird, then you need this branch: https://github.com/waifuvault/WaifuVault/tree/bump-version

Thank you very much :(

from tsed.

Romakita avatar Romakita commented on May 27, 2024

I'm not able to start the project, the DB doesn't start XD

from tsed.

VictoriqueMoe avatar VictoriqueMoe commented on May 27, 2024

I'm not able to start the project, the DB doesn't start XD

use this env

PORT=localhost:8081
HTTPS=false
HTTPS_PORT=4000
SESSION_KEY=YourSessionKey
NODE_ENV=development
BASE_URL=http://localhost:8081
FILE_SIZE_UPLOAD_LIMIT_MB=512

should start. DB is just sqlite. should not have a problem

from tsed.

VictoriqueMoe avatar VictoriqueMoe commented on May 27, 2024

oh yeh, run npm run runmigration

then it should work :)

from tsed.

Romakita avatar Romakita commented on May 27, 2024

That's what I told myself and created the .env, but strangely I got this:

  event: 'SERVER_BOOTSTRAP_ERROR',
  message: 'no such table: user_model',
  stack: 'SqliteError: no such table: user_model\n' +

from tsed.

VictoriqueMoe avatar VictoriqueMoe commented on May 27, 2024

image

yeh, you need to do npm run runmigration to create the tables

from tsed.

Romakita avatar Romakita commented on May 27, 2024

Here is the swagger docs:

Capture d’écran 2024-05-02 aΜ€ 17 32 40

from tsed.

Romakita avatar Romakita commented on May 27, 2024

But isn't on your branch. I'll checkout your branch to see if there is dependencies issue

from tsed.

VictoriqueMoe avatar VictoriqueMoe commented on May 27, 2024

But isn't on your branch. I'll checkout your branch to see if there is dependencies issue

oh yea, on the main branch it is ok. but the branch i posted is the issue one :)

from tsed.

Romakita avatar Romakita commented on May 27, 2024

oh yea, on the main branch it is ok. but the branch i posted is the issue one :)
On the main branch, I updated the packages. ho hey I don't make this kind of mistake yet :p

On your branch I have the swagger ui also :D

from tsed.

Romakita avatar Romakita commented on May 27, 2024
Capture d’écran 2024-05-02 aΜ€ 17 39 29

I have to clear the browser cache. After that, I saw the new swagger ui version ^^. Maybe you have to clear your cache also.

from tsed.

VictoriqueMoe avatar VictoriqueMoe commented on May 27, 2024

I have to clear the browser cache. After that, I saw the new swagger ui version ^^. Maybe you have to clear your cache also.

Is this the new branch? clearing my cashe did nothing, and using different browsers
image

from tsed.

Romakita avatar Romakita commented on May 27, 2024

I see you have 127.0.0.1, can you try with localhost ?

from tsed.

Romakita avatar Romakita commented on May 27, 2024

Try also to curl this url: http://localhost:8081/api-docs/swagger-ui-standalone-preset.js

I have that in the console:

[2024-05-02T17:47:01.832] [INFO ] [TSED] - {
  reqId: 'efdf6738859042d7a89f7e8569a46ad4',
  method: 'GET',
  url: '/api-docs/swagger-ui-standalone-preset.js',
  duration: 8,
  route: '/api-docs',
  time: 2024-05-02T15:47:01.832Z,
  event: 'request.end',
  status: 200,
  status_code: '200',
  state: 'OK'
}

from tsed.

VictoriqueMoe avatar VictoriqueMoe commented on May 27, 2024

I see you have 127.0.0.1, can you try with localhost ?

yes, i set my env to BASE_URL=http://127.0.0.1:8081 because setting it to localhost doesn't work with the printed text on console.

but this doesn't fix it
image

and CURL doesn't work too
image

from tsed.

Romakita avatar Romakita commented on May 27, 2024

Hum ok, but you have PORT=localhost:8081 ?

from tsed.

VictoriqueMoe avatar VictoriqueMoe commented on May 27, 2024

my env

PORT=localhost:8081
SESSION_KEY=foo
HTTPS=false
HTTPS_PORT=4000
NODE_ENV=development
BASE_URL=http://localhost:8081
FILE_SIZE_UPLOAD_LIMIT_MB=9000
#CLAM_PATH="Y:\dp\Dropbox\Portable apps\clamav-1.2.1.win.x64"
BLOCKED_MIME_TYPES=application/x-dosexec,application/x-executable,application/x-hdf5,application/x-java-archive,application/vnd.rar
USE_CLOUDFLARE=false
MAX_URL_LENGTH=4096
SALT=3jS'f;Β£[
UPLOAD_SECRET=foobar
MS_DEFENDER_PATH="C:\Program Files\Windows Defender"

from tsed.

VictoriqueMoe avatar VictoriqueMoe commented on May 27, 2024

Hum ok, but you have PORT=localhost:8081 ?

oh yeh, all the Webservices and home page load fine. just swagger

from tsed.

VictoriqueMoe avatar VictoriqueMoe commented on May 27, 2024

do you think this is a Windows issue?

https://github.com/tsedio/tsed/pull/2684/files#diff-07ce5883fa56206cafb68b3fe4fb05749942a433254ca1317f0cb4540ff64966R5

maybe use path.sep?

from tsed.

Romakita avatar Romakita commented on May 27, 2024

heu.....yes probably XD

from tsed.

Romakita avatar Romakita commented on May 27, 2024

can you edit the node_module/@tsed/swagger/dist/lib/constants.js and change the / pls ?

from tsed.

VictoriqueMoe avatar VictoriqueMoe commented on May 27, 2024

that said, Windows works with both / and \

path.sep should give the right / based on OS, as should path.normalize and path.resolve but eh. weird

from tsed.

VictoriqueMoe avatar VictoriqueMoe commented on May 27, 2024

can you edit the node_module/@tsed/swagger/dist/lib/constants.js and change the / pls ?

sure. one sec

from tsed.

Romakita avatar Romakita commented on May 27, 2024

You have certainly right, this is probably the problem ;)

from tsed.

VictoriqueMoe avatar VictoriqueMoe commented on May 27, 2024

yeh.

dirname(import.meta.resolve("swagger-ui-dist"))

resolves to: file:///C:/Users/ray-q/IdeaProjects/WaifuVault/node_modules/swagger-ui-dist
so

dirname(import.meta.resolve("swagger-ui-dist")).replace("file://", "")

resolves to: /C:/Users/ray-q/IdeaProjects/WaifuVault/node_modules/swagger-ui-dist
notice the / at the start :D

from tsed.

Romakita avatar Romakita commented on May 27, 2024

Hum ok T.T
Now we can try to fix that xD

from tsed.

VictoriqueMoe avatar VictoriqueMoe commented on May 27, 2024
export const SWAGGER_UI_DIST = normalize(dirname(import.meta.resolve("swagger-ui-dist"))).replace(`file:${sep}`, "");

seems to work... but not sure for linux

but i kinda hate it

from tsed.

VictoriqueMoe avatar VictoriqueMoe commented on May 27, 2024

Sure, I'll try it when I'm back at my pc

from tsed.

Romakita avatar Romakita commented on May 27, 2024

PR is ready ;).

from tsed.

VictoriqueMoe avatar VictoriqueMoe commented on May 27, 2024

Yes, this works too

from tsed.

github-actions avatar github-actions commented on May 27, 2024

πŸŽ‰ Are you happy?

If you appreciated the support, know that it is free and is carried out on personal time ;)

A support, even a little bit makes a difference for me and continues to bring you answers!

github opencollective

from tsed.

Romakita avatar Romakita commented on May 27, 2024

πŸŽ‰ This issue has been resolved in version 7.68.5 πŸŽ‰

The release is available on:

Your semantic-release bot πŸ“¦πŸš€

from tsed.

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.