Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: studio 404 not found #332

Closed
wants to merge 2 commits into from
Closed

fix: studio 404 not found #332

wants to merge 2 commits into from

Conversation

to-kr
Copy link

@to-kr to-kr commented Sep 7, 2022

Conditional resolve of Studio Build depending on installation type.

Related issue(s)
Resolves #244

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 7, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Member

@derberg derberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@to-kr sorry for jumping into review with such delay 😞

thanks for trying to fix the issue, but I'm not 100% sure it is the best we can do. It is still kinda hacky to have hardcoded paths

could you try to use require.resolve to dynamically check where @asyncapi/studio is located?

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Comment on lines +47 to +49
const studioBuildFolder = existsSync(resolve(__dirname, '../../node_modules/@asyncapi/studio/build')) ?
resolve(__dirname, '../../node_modules/@asyncapi/studio/build') :
resolve(__dirname, '../../../../@asyncapi/studio/build');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const studioBuildFolder = existsSync(resolve(__dirname, '../../node_modules/@asyncapi/studio/build')) ?
resolve(__dirname, '../../node_modules/@asyncapi/studio/build') :
resolve(__dirname, '../../../../@asyncapi/studio/build');
const studioBuildFolder = require.resolve('@asyncapi/studio/build/index.html');

this should be universal solution. Works on my side, npm user.
wdyt?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@to-kr do you plan to continue with this one?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I didn't catch your previous answer. Your solution looks good. Please fix it yourself.

@derberg
Copy link
Member

derberg commented Mar 27, 2023

closing in favour of #489

@derberg derberg closed this Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Studio 404 not found
2 participants