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 proxy not working with typescript #212

Merged
merged 2 commits into from
Dec 19, 2023

Conversation

Arnei
Copy link
Member

@Arnei Arnei commented Oct 12, 2023

"setupProxy" relies on CRA auto-magic, but the magic will only work if it has the ".js" extension. And then I also changed something in the tsconfig that seems unrelated to me and now it works...?

Fixes #210 .

"setupProxy" relies on CRA auto-magic, but the magic will only
work if it has the ".js" extension. And then I also changed something
in the tsconfig that seems unrelated to me and now it works...?
@Arnei Arnei added the type:bug Something isn't working label Oct 12, 2023
Copy link
Contributor

@owi92 owi92 left a comment

Choose a reason for hiding this comment

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

Can confirm that this fixes the issue! Though I am uncertain whether the changes in tsconfig are really necessary. Well they also don't seem to break anything so maybe just keep them 🤷

@@ -1,4 +1,8 @@
{
"exclude": [
"node_modules",
"dist"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can remove the dist line, if I'm not mistaken. At least I don't see any folder with that name, and it seems to work without.

Actually, things still work when I comment out the whole exclude array, can you confirm that? If so, I guess you can remove that as well.

@@ -40,7 +44,7 @@

/* JavaScript Support */
"allowJs": false, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
"checkJs": false, /* Enable error reporting in type-checked JavaScript files. */
Copy link
Contributor

Choose a reason for hiding this comment

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

Commenting this out again also doesn't seem to make any difference. I mean I guess that makes sense since that should theoretically be equivalent to setting this to false.
I don't think you made these changes without reason though, so maybe I'm doing something wrong while testing this.

@Arnei
Copy link
Member Author

Arnei commented Nov 21, 2023

Seems the changes to the tsconfig were indeed unnecessary? Weird, could've sworn the exclude was important. But hey, the simpler our config the better.

@@ -44,7 +40,7 @@

/* JavaScript Support */
"allowJs": false, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
"checkJs": false, /* Enable error reporting in type-checked JavaScript files. */
"checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
Copy link
Contributor

Choose a reason for hiding this comment

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

Err wait, I believe you just need to comment this line out. Setting it to true gives me an error in the tsconfig file because allowJs also needs to be enabled for this. But also, I'm a little confused by this. JS is not allowed (line 42) but setupProxy.js is cleary a JS file. Or does that not count as "part of the program"? 🤨

@owi92
Copy link
Contributor

owi92 commented Nov 21, 2023

Ok hold on, I've just tested this with the redux-toolkit branch I also "reviewed" the other day, and it seems like the tsconfig changes you made are necessary after all, at least for that PR (minus the dist thing in line 4). I'm really sorry for this back and forth, maybe you can understand my confusion.

I think I would suggest to either drop your latest revert-commit here, or make the corresponding tsconfig changes in #214 instead.

Apparently it does not help with fixing the issue with the
setup proxy, so we might as well simplify the config a little.
@Arnei Arnei force-pushed the fix-proxy-not-working-with-ts branch from 55c43ac to 313bf44 Compare November 21, 2023 14:49
@owi92 owi92 mentioned this pull request Nov 23, 2023
@Arnei Arnei merged commit 47d7ce8 into opencast:admin-ui-picard Dec 19, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typescript broke proxy
2 participants